public static interface TreeDef.Parented<T> extends TreeDef<T>
It is critical that the TreeDef.Parented is consistent - if Vader claims that Luke
and Leia are his children, then both Luke and Leia must say that Vader is their parent.
If Luke or Leia don't agree that Vader is their father, then the algorithms that use
this TreeDef.Parented are likely to fail in unexpected ways.
TreeDef.Parented<T>| Modifier and Type | Method and Description |
|---|---|
default TreeDef.Parented<T> |
filter(Predicate<T> predicate)
Creates a new
TreeDef.Parented whose childrenOf and parentOf methods are filtered by predicate. |
static <T> TreeDef.Parented<T> |
of(Function<T,List<T>> childFunc,
Function<T,T> parentFunc)
Creates a new
TreeDef.Parented which is implemented by the two given functions. |
T |
parentOf(T node)
Returns the parent of the given node.
|
childrenOf, filteredList, forFile, forPath, ofdefault TreeDef.Parented<T> filter(Predicate<T> predicate)
TreeDef.Parented whose childrenOf and parentOf methods are filtered by predicate.static <T> TreeDef.Parented<T> of(Function<T,List<T>> childFunc, Function<T,T> parentFunc)
TreeDef.Parented which is implemented by the two given functions.