@Immutable public final class TreeWithIDBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
static <KEYTYPE,DATATYPE extends IHasParent<DATATYPE> & IHasID<KEYTYPE>> |
buildTree(Collection<? extends DATATYPE> aAll)
A generic method to build a tree of objects.
|
static <KEYTYPE,DATATYPE extends IHasID<KEYTYPE>> |
buildTree(Collection<? extends DATATYPE> aAll,
IParentProvider<DATATYPE> aParentResolver)
A generic method to build a tree of objects.
|
static <KEYTYPE,DATATYPE extends IHasID<KEYTYPE>> |
buildTree(DATATYPE[] aAll,
IParentProvider<DATATYPE> aParentResolver)
A generic method to build a tree of objects.
|
static <KEYTYPE,DATATYPE extends IHasID<KEYTYPE>> |
buildTree(IChildrenProvider<DATATYPE> aChildrenResolver) |
@Nonnull public static <KEYTYPE,DATATYPE extends IHasID<KEYTYPE>> DefaultTreeWithID<KEYTYPE,DATATYPE> buildTree(@Nonnull Collection<? extends DATATYPE> aAll, @Nonnull 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 IHasID<KEYTYPE>> DefaultTreeWithID<KEYTYPE,DATATYPE> buildTree(@Nonnull DATATYPE[] aAll, @Nonnull 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 IHasParent<DATATYPE> & 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 IHasID<KEYTYPE>> DefaultTreeWithID<KEYTYPE,DATATYPE> buildTree(@Nonnull IChildrenProvider<DATATYPE> aChildrenResolver)
Copyright © 2006–2014 phloc systems. All rights reserved.