@Immutable public final class TreeWithIDBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
static <KEYTYPE,DATATYPE extends com.helger.commons.hierarchy.IHasParent<DATATYPE> & com.helger.commons.id.IHasID<KEYTYPE>> |
buildTree(Collection<? extends DATATYPE> aAll)
A generic method to build a tree of objects.
|
static <KEYTYPE,DATATYPE extends com.helger.commons.id.IHasID<KEYTYPE>> |
buildTree(Collection<? extends DATATYPE> aAll,
com.helger.commons.hierarchy.IParentProvider<DATATYPE> aParentResolver)
A generic method to build a tree of objects.
|
static <KEYTYPE,DATATYPE extends com.helger.commons.id.IHasID<KEYTYPE>> |
buildTree(DATATYPE[] aAll,
com.helger.commons.hierarchy.IParentProvider<DATATYPE> aParentResolver)
A generic method to build a tree of objects.
|
static <KEYTYPE,DATATYPE extends com.helger.commons.id.IHasID<KEYTYPE>> |
buildTree(com.helger.commons.hierarchy.IChildrenProvider<DATATYPE> aChildrenResolver) |
@Nonnull public static <KEYTYPE,DATATYPE extends com.helger.commons.id.IHasID<KEYTYPE>> DefaultTreeWithID<KEYTYPE,DATATYPE> buildTree(@Nonnull Collection<? extends DATATYPE> aAll, @Nonnull com.helger.commons.hierarchy.IParentProvider<DATATYPE> aParentResolver)
KEYTYPE - The tree key type.DATATYPE - The tree item value type.aAll - A linear list of objects to build the tree from. May not be
null.aParentResolver - The callback method to determine the parental object of a given
object. May not be null.null.IllegalStateException - if the hierarchy cannot be determined because an object references
a parent that is not in the list!@Nonnull public static <KEYTYPE,DATATYPE extends com.helger.commons.id.IHasID<KEYTYPE>> DefaultTreeWithID<KEYTYPE,DATATYPE> buildTree(@Nonnull DATATYPE[] aAll, @Nonnull com.helger.commons.hierarchy.IParentProvider<DATATYPE> aParentResolver)
KEYTYPE - The tree key type.DATATYPE - The tree item value type.aAll - A linear list of objects to build the tree from. May not be
null.aParentResolver - The callback method to determine the parental object of a given
object. May not be null.null.IllegalStateException - if the hierarchy cannot be determined because an object references
a parent that is not in the list!@Nonnull public static <KEYTYPE,DATATYPE extends com.helger.commons.hierarchy.IHasParent<DATATYPE> & com.helger.commons.id.IHasID<KEYTYPE>> DefaultTreeWithID<KEYTYPE,DATATYPE> buildTree(@Nonnull Collection<? extends DATATYPE> aAll)
KEYTYPE - The tree key type.DATATYPE - The tree item value type.aAll - A linear list of objects to build the tree from. May not be
null.null.IllegalStateException - if the hierarchy cannot be determined because an object references
a parent that is not in the list!@Nonnull public static <KEYTYPE,DATATYPE extends com.helger.commons.id.IHasID<KEYTYPE>> DefaultTreeWithID<KEYTYPE,DATATYPE> buildTree(@Nonnull com.helger.commons.hierarchy.IChildrenProvider<DATATYPE> aChildrenResolver)
Copyright © 2014–2021 Philip Helger. All rights reserved.