KEYTYPE - The type of the key elements for the tree.DATATYPE - The type of the elements contained in the treeITEMTYPE - tree item type@NotThreadSafe public class BasicTreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> extends BasicTreeWithID<KEYTYPE,DATATYPE,ITEMTYPE> implements ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE>
| Constructor and Description |
|---|
BasicTreeWithGlobalUniqueID(ITreeItemWithUniqueIDFactory<KEYTYPE,DATATYPE,ITEMTYPE> aFactory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsItemWithID(KEYTYPE aDataID)
Check if a tree item corresponding to the given ID is present.
|
boolean |
equals(Object o) |
com.helger.commons.collection.impl.ICommonsList<? extends ITEMTYPE> |
getAllChildren(ITEMTYPE aItem) |
com.helger.commons.collection.impl.ICommonsCollection<DATATYPE> |
getAllItemDatas() |
com.helger.commons.collection.impl.ICommonsCollection<ITEMTYPE> |
getAllItems() |
int |
getChildCount(ITEMTYPE aItem) |
ITEMTYPE |
getChildWithID(ITEMTYPE aCurrentItem,
KEYTYPE aDataID) |
protected ITreeItemWithUniqueIDFactory<KEYTYPE,DATATYPE,ITEMTYPE> |
getFactory() |
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 |
hasChildren(ITEMTYPE aItem) |
int |
hashCode() |
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
|
String |
toString() |
forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getChildCount, getChildren, getRootItem, hasChildrenclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetRootItempublic BasicTreeWithGlobalUniqueID(@Nonnull ITreeItemWithUniqueIDFactory<KEYTYPE,DATATYPE,ITEMTYPE> aFactory)
@Nonnull protected final ITreeItemWithUniqueIDFactory<KEYTYPE,DATATYPE,ITEMTYPE> getFactory()
public final boolean containsItemWithID(@Nullable KEYTYPE aDataID)
ITreeWithGlobalUniqueIDcontainsItemWithID in interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>aDataID - The ID of the tree item to search.true if such an item is present@Nullable public final ITEMTYPE getItemWithID(@Nullable KEYTYPE aDataID)
ITreeWithGlobalUniqueIDITreeItemWithID that corresponds to the given ID.getItemWithID in interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>aDataID - The ID of the tree item to search.null if no such tree item exists.@Nullable public final DATATYPE getItemDataWithID(@Nullable KEYTYPE aDataID)
ITreeWithGlobalUniqueIDgetItemDataWithID in interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>aDataID - The ID of the tree item to search.null if no such tree item exists.@Nullable public final ITEMTYPE getChildWithID(@Nullable ITEMTYPE aCurrentItem, @Nullable KEYTYPE aDataID)
@Nonnegative public final int getItemCount()
getItemCount in interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsCollection<ITEMTYPE> getAllItems()
getAllItems in interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>null collection of all items.@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsCollection<DATATYPE> getAllItemDatas()
getAllItemDatas in interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>null collection of all item datas.@Nonnull public final com.helger.commons.state.EChange removeItemWithID(@Nullable KEYTYPE aDataID)
ITreeWithGlobalUniqueIDremoveItemWithID in interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>aDataID - The ID of the item to be removedEChange.CHANGED if the item was removed,
EChange.UNCHANGED otherwise. Never null.public final boolean isItemSameOrDescendant(@Nullable KEYTYPE aParentItemID, @Nullable KEYTYPE aChildItemID)
ITreeWithGlobalUniqueIDisItemSameOrDescendant in interface ITreeWithGlobalUniqueID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>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.public boolean hasChildren(@Nullable ITEMTYPE aItem)
hasChildren in interface com.helger.commons.hierarchy.IChildrenProvider<ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>@Nonnegative public int getChildCount(@Nullable ITEMTYPE aItem)
getChildCount in interface com.helger.commons.hierarchy.IChildrenProvider<ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>@Nullable public com.helger.commons.collection.impl.ICommonsList<? extends ITEMTYPE> getAllChildren(@Nullable ITEMTYPE aItem)
getAllChildren in interface com.helger.commons.hierarchy.IChildrenProvider<ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>public boolean equals(Object o)
equals in class BasicTreeWithID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>public int hashCode()
hashCode in class BasicTreeWithID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>public String toString()
toString in class BasicTreeWithID<KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>Copyright © 2014–2021 Philip Helger. All rights reserved.