KEYTYPE - The type of the key elements for the tree. This is typically String.DATATYPE - The type of the elements contained in the tree. This is the generic
type to be stored in the tree.ITEMTYPE - The type of the tree item that will be stored in this tree.public interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> extends ITreeWithID<KEYTYPE,DATATYPE,ITEMTYPE>, IChildrenProviderWithID<KEYTYPE,ITEMTYPE>
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsItemWithID(KEYTYPE aDataID)
Check if a tree item corresponding to the given ID is present.
|
Collection<DATATYPE> |
getAllItemDatas() |
Collection<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.
|
EChange |
removeItemWithID(KEYTYPE aDataID)
Remove the item with the specified ID
|
getRootItemgetAllChildren, getChildCount, hasChildren, hasNoChildrengetChildWithIDgetAllChildren, getChildCount, hasChildren, hasNoChildrenboolean containsItemWithID(@Nullable KEYTYPE aDataID)
aDataID - The ID of the tree item to search.true if such an item is present@Nullable ITEMTYPE getItemWithID(@Nullable KEYTYPE aDataID)
ITreeItemWithID that corresponds to the given ID.aDataID - The ID of the tree item to search.null if no such tree item exists.@Nullable DATATYPE getItemDataWithID(@Nullable KEYTYPE aDataID)
aDataID - The ID of the tree item to search.null if no such tree item exists.@Nonnegative int getItemCount()
@Nonnull Collection<ITEMTYPE> getAllItems()
null collection of all items.@Nonnull Collection<DATATYPE> getAllItemDatas()
null collection of all item datas.@Nonnull EChange removeItemWithID(@Nullable KEYTYPE aDataID)
aDataID - The ID of the item to be removedEChange.CHANGED if the item was removed,
EChange.UNCHANGED otherwise. Never null.boolean isItemSameOrDescendant(@Nullable KEYTYPE aParentItemID, @Nullable KEYTYPE aChildItemID)
aParentItemID - The parent item ID to a validate.aChildItemID - The item ID to check whether it is a child of the passed parent
folder.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.Copyright © 2014–2016 Philip Helger. All rights reserved.