Package com.helger.tree.util
Class TreeWithIDSearcher
- java.lang.Object
-
- com.helger.tree.util.TreeWithIDSearcher
-
@Immutable public final class TreeWithIDSearcher extends Object
A utility class that helps searching items within trees.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>
com.helger.commons.collection.impl.ICommonsList<ITEMTYPE>findAllItemsWithIDRecursive(IBasicTree<DATATYPE,ITEMTYPE> aTree, KEYTYPE aSearchID)Fill all items with the same ID by linearly scanning of the tree.static <KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>>
com.helger.commons.collection.impl.ICommonsList<ITEMTYPE>findAllItemsWithIDRecursive(ITEMTYPE aTreeItem, KEYTYPE aSearchID)Fill all items with the same ID by linearly scanning the tree.
-
-
-
Method Detail
-
findAllItemsWithIDRecursive
@Nonnull @ReturnsMutableCopy public static <KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> com.helger.commons.collection.impl.ICommonsList<ITEMTYPE> findAllItemsWithIDRecursive(@Nonnull IBasicTree<DATATYPE,ITEMTYPE> aTree, @Nullable KEYTYPE aSearchID)
Fill all items with the same ID by linearly scanning of the tree.- Type Parameters:
KEYTYPE- tree ID typeDATATYPE- tree data typeITEMTYPE- tree item type- Parameters:
aTree- The tree to search. May not benull.aSearchID- The ID to search. May not benull.- Returns:
- A non-
nulllist with all matching items.
-
findAllItemsWithIDRecursive
@Nonnull @ReturnsMutableCopy public static <KEYTYPE,DATATYPE,ITEMTYPE extends ITreeItemWithID<KEYTYPE,DATATYPE,ITEMTYPE>> com.helger.commons.collection.impl.ICommonsList<ITEMTYPE> findAllItemsWithIDRecursive(@Nonnull ITEMTYPE aTreeItem, @Nullable KEYTYPE aSearchID)
Fill all items with the same ID by linearly scanning the tree.- Type Parameters:
KEYTYPE- tree ID typeDATATYPE- tree data typeITEMTYPE- tree item type- Parameters:
aTreeItem- The tree item to search. May not benull.aSearchID- The ID to search. May not benull.- Returns:
- A non-
nulllist with all matching items.
-
-