Interface ITreeWithGlobalUniqueID<KEYTYPE,​DATATYPE,​ITEMTYPE extends ITreeItemWithID<KEYTYPE,​DATATYPE,​ITEMTYPE>>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean containsItemWithID​(KEYTYPE aDataID)
      Check if a tree item corresponding to the given ID is present.
      com.helger.commons.collection.impl.ICommonsCollection<DATATYPE> getAllItemDatas()  
      com.helger.commons.collection.impl.ICommonsCollection<ITEMTYPE> getAllItems()  
      int getItemCount()  
      DATATYPE getItemDataWithID​(KEYTYPE aDataID)
      Get the data of the tree item that corresponds to the given ID.
      ITEMTYPE getItemWithID​(KEYTYPE aDataID)
      Get the ITreeItemWithID that corresponds to the given ID.
      boolean isItemSameOrDescendant​(KEYTYPE aParentItemID, KEYTYPE aChildItemID)
      Check if one item is equal or a child of the other item.
      com.helger.commons.state.EChange removeItemWithID​(KEYTYPE aDataID)
      Remove the item with the specified ID
      • Methods inherited from interface com.helger.commons.hierarchy.IChildrenProvider

        getAllChildren, getChildCount, hasChildren, hasNoChildren
      • Methods inherited from interface com.helger.commons.hierarchy.IChildrenProviderWithID

        getChildWithID
      • Methods inherited from interface com.helger.commons.hierarchy.IHasChildren

        forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getChildCount, getChildren, hasChildren, hasNoChildren
    • Method Detail

      • containsItemWithID

        boolean containsItemWithID​(@Nullable
                                   KEYTYPE aDataID)
        Check if a tree item corresponding to the given ID is present.
        Parameters:
        aDataID - The ID of the tree item to search.
        Returns:
        true if such an item is present
      • getItemDataWithID

        @Nullable
        DATATYPE getItemDataWithID​(@Nullable
                                   KEYTYPE aDataID)
        Get the data of the tree item that corresponds to the given ID.
        Parameters:
        aDataID - The ID of the tree item to search.
        Returns:
        null if no such tree item exists.
      • getItemCount

        @Nonnegative
        int getItemCount()
        Returns:
        The number of all contained items. Always ≥ 0.
      • getAllItems

        @Nonnull
        com.helger.commons.collection.impl.ICommonsCollection<ITEMTYPE> getAllItems()
        Returns:
        A non-null collection of all items.
      • getAllItemDatas

        @Nonnull
        com.helger.commons.collection.impl.ICommonsCollection<DATATYPE> getAllItemDatas()
        Returns:
        A non-null collection of all item datas.
      • removeItemWithID

        @Nonnull
        com.helger.commons.state.EChange removeItemWithID​(@Nullable
                                                          KEYTYPE aDataID)
        Remove the item with the specified ID
        Parameters:
        aDataID - The ID of the item to be removed
        Returns:
        EChange.CHANGED if the item was removed, EChange.UNCHANGED otherwise. Never null.
      • isItemSameOrDescendant

        boolean isItemSameOrDescendant​(@Nullable
                                       KEYTYPE aParentItemID,
                                       @Nullable
                                       KEYTYPE aChildItemID)
        Check if one item is equal or a child of the other item. This relationship is checked not only for direct children but for all levels.
        Parameters:
        aParentItemID - The parent item ID to a validate.
        aChildItemID - The item ID to check whether it is a child of the passed parent folder.
        Returns:
        true if the child item is the same or a child of the parent item, false if one of the IDs could not be resolved or they are not in a parent-child-relationship.