Package com.helger.tree.singleton
Interface ITreeWithUniqueIDProxy<KEYTYPE,VALUETYPE>
-
- Type Parameters:
KEYTYPE- Tree key typeVALUETYPE- Tree value type
- All Superinterfaces:
IBasicTree<VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>,com.helger.commons.hierarchy.IChildrenProvider<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>,com.helger.commons.hierarchy.IChildrenProviderWithID<KEYTYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>,com.helger.commons.hierarchy.IHasChildren<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>,ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>,ITreeWithID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>
- All Known Implementing Classes:
AbstractGlobalSingletonTreeWithUniqueID,AbstractRequestSingletonTreeWithUniqueID,AbstractSessionSingletonTreeWithUniqueID
public interface ITreeWithUniqueIDProxy<KEYTYPE,VALUETYPE> extends ITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>
Default proxy interface forITreeWithGlobalUniqueID.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancontainsItemWithID(KEYTYPE aDataID)Check if a tree item corresponding to the given ID is present.default voidforAllChildren(Consumer<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> aConsumer)default voidforAllChildren(Predicate<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> aFilter, Consumer<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> aConsumer)default <DSTTYPE> voidforAllChildrenMapped(Predicate<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> aFilter, Function<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>,? extends DSTTYPE> aMapper, Consumer<? super DSTTYPE> aConsumer)default com.helger.commons.collection.impl.ICommonsCollection<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>getAllChildren()default com.helger.commons.collection.impl.ICommonsCollection<? extends DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>getAllChildren(DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)default com.helger.commons.collection.impl.ICommonsCollection<VALUETYPE>getAllItemDatas()default com.helger.commons.collection.impl.ICommonsCollection<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>getAllItems()default intgetChildCount()default intgetChildCount(DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)default com.helger.commons.collection.impl.ICommonsIterable<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>getChildren()default DefaultTreeItemWithID<KEYTYPE,VALUETYPE>getChildWithID(DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent, KEYTYPE aID)default intgetItemCount()default VALUETYPEgetItemDataWithID(KEYTYPE aDataID)Get the data of the tree item that corresponds to the given ID.default DefaultTreeItemWithID<KEYTYPE,VALUETYPE>getItemWithID(KEYTYPE aDataID)Get theITreeItemWithIDthat corresponds to the given ID.DefaultTreeWithGlobalUniqueID<KEYTYPE,VALUETYPE>getProxyTree()default DefaultTreeItemWithID<KEYTYPE,VALUETYPE>getRootItem()default booleanhasChildren()default booleanhasChildren(DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)default booleanhasNoChildren()default booleanhasNoChildren(DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)default booleanisItemSameOrDescendant(KEYTYPE aParentItemID, KEYTYPE aChildItemID)Check if one item is equal or a child of the other item.default com.helger.commons.state.EChangeremoveItemWithID(KEYTYPE aDataID)Remove the item with the specified ID
-
-
-
Method Detail
-
getProxyTree
@Nonnull DefaultTreeWithGlobalUniqueID<KEYTYPE,VALUETYPE> getProxyTree()
-
hasChildren
default boolean hasChildren()
- Specified by:
hasChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<KEYTYPE>
-
hasNoChildren
default boolean hasNoChildren()
- Specified by:
hasNoChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<KEYTYPE>
-
getChildCount
@Nonnegative default int getChildCount()
- Specified by:
getChildCountin interfacecom.helger.commons.hierarchy.IHasChildren<KEYTYPE>
-
getAllChildren
@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.impl.ICommonsCollection<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> getAllChildren()
- Specified by:
getAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<KEYTYPE>
-
getChildren
@Nullable default com.helger.commons.collection.impl.ICommonsIterable<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> getChildren()
- Specified by:
getChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<KEYTYPE>
-
forAllChildren
default void forAllChildren(@Nonnull Consumer<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> aConsumer)
- Specified by:
forAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<KEYTYPE>
-
forAllChildren
default void forAllChildren(@Nonnull Predicate<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> aFilter, @Nonnull Consumer<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> aConsumer)
- Specified by:
forAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<KEYTYPE>
-
forAllChildrenMapped
default <DSTTYPE> void forAllChildrenMapped(@Nonnull Predicate<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> aFilter, @Nonnull Function<? super DefaultTreeItemWithID<KEYTYPE,VALUETYPE>,? extends DSTTYPE> aMapper, @Nonnull Consumer<? super DSTTYPE> aConsumer)
- Specified by:
forAllChildrenMappedin interfacecom.helger.commons.hierarchy.IHasChildren<KEYTYPE>
-
getRootItem
@Nonnull default DefaultTreeItemWithID<KEYTYPE,VALUETYPE> getRootItem()
- Specified by:
getRootItemin interfaceIBasicTree<KEYTYPE,VALUETYPE>- Returns:
- The root item of the tree. Never
null. The root item should not be displayed but it is the parent node of all displayed root items and therefore cannot be removed.
-
getChildWithID
@Nullable default DefaultTreeItemWithID<KEYTYPE,VALUETYPE> getChildWithID(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent, @Nullable KEYTYPE aID)
-
hasChildren
default boolean hasChildren(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)
- Specified by:
hasChildrenin interfacecom.helger.commons.hierarchy.IChildrenProvider<KEYTYPE>
-
hasNoChildren
default boolean hasNoChildren(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)
- Specified by:
hasNoChildrenin interfacecom.helger.commons.hierarchy.IChildrenProvider<KEYTYPE>
-
getChildCount
@Nonnegative default int getChildCount(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)
- Specified by:
getChildCountin interfacecom.helger.commons.hierarchy.IChildrenProvider<KEYTYPE>
-
getAllChildren
@Nullable default com.helger.commons.collection.impl.ICommonsCollection<? extends DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> getAllChildren(@Nullable DefaultTreeItemWithID<KEYTYPE,VALUETYPE> aCurrent)
- Specified by:
getAllChildrenin interfacecom.helger.commons.hierarchy.IChildrenProvider<KEYTYPE>
-
getItemWithID
@Nullable default DefaultTreeItemWithID<KEYTYPE,VALUETYPE> getItemWithID(@Nullable KEYTYPE aDataID)
Description copied from interface:ITreeWithGlobalUniqueIDGet theITreeItemWithIDthat corresponds to the given ID.- Specified by:
getItemWithIDin interfaceITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>- Parameters:
aDataID- The ID of the tree item to search.- Returns:
nullif no such tree item exists.
-
getItemCount
@Nonnegative default int getItemCount()
- Specified by:
getItemCountin interfaceITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>- Returns:
- The number of all contained items. Always ≥ 0.
-
getAllItems
@Nonnull default com.helger.commons.collection.impl.ICommonsCollection<DefaultTreeItemWithID<KEYTYPE,VALUETYPE>> getAllItems()
- Specified by:
getAllItemsin interfaceITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>- Returns:
- A non-
nullcollection of all items.
-
isItemSameOrDescendant
default boolean isItemSameOrDescendant(@Nullable KEYTYPE aParentItemID, @Nullable KEYTYPE aChildItemID)
Description copied from interface:ITreeWithGlobalUniqueIDCheck 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.- Specified by:
isItemSameOrDescendantin interfaceITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>- 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:
trueif the child item is the same or a child of the parent item,falseif one of the IDs could not be resolved or they are not in a parent-child-relationship.
-
containsItemWithID
default boolean containsItemWithID(@Nullable KEYTYPE aDataID)
Description copied from interface:ITreeWithGlobalUniqueIDCheck if a tree item corresponding to the given ID is present.- Specified by:
containsItemWithIDin interfaceITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>- Parameters:
aDataID- The ID of the tree item to search.- Returns:
trueif such an item is present
-
getItemDataWithID
@Nullable default VALUETYPE getItemDataWithID(@Nullable KEYTYPE aDataID)
Description copied from interface:ITreeWithGlobalUniqueIDGet the data of the tree item that corresponds to the given ID.- Specified by:
getItemDataWithIDin interfaceITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>- Parameters:
aDataID- The ID of the tree item to search.- Returns:
nullif no such tree item exists.
-
getAllItemDatas
@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.impl.ICommonsCollection<VALUETYPE> getAllItemDatas()
- Specified by:
getAllItemDatasin interfaceITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>- Returns:
- A non-
nullcollection of all item datas.
-
removeItemWithID
@Nonnull default com.helger.commons.state.EChange removeItemWithID(@Nullable KEYTYPE aDataID)
Description copied from interface:ITreeWithGlobalUniqueIDRemove the item with the specified ID- Specified by:
removeItemWithIDin interfaceITreeWithGlobalUniqueID<KEYTYPE,VALUETYPE,DefaultTreeItemWithID<KEYTYPE,VALUETYPE>>- Parameters:
aDataID- The ID of the item to be removed- Returns:
EChange.CHANGEDif the item was removed,EChange.UNCHANGEDotherwise. Nevernull.
-
-