Tree.Branch<T>, Tree.Leaf<T>| Constructor and Description |
|---|
Branch(List<Tree<T>> children,
String label)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Tree.Branch<T> |
asBranch()
Returns this instance as a Branch if it's a branch,
or null if it's a leaf.
|
Tree.Leaf<T> |
asLeaf()
Returns this instance as a Leaf if it's a leaf,
or null if it's a branch.
|
List<Tree<T>> |
getChildren()
Returns this branch's children.
|
String |
getLabel()
Returns this branch's label.
|
boolean |
isLeaf()
Returns true if this instance is a Leaf, false if it's a Branch.
|
<R> Tree.Branch<R> |
map(java.util.function.Function<T,R> mapping)
Recursively converts this Tree to one with the same structure,
but with the leaf items mapped from their existing values to
new values determined by a supplied mapping function.
|
public List<Tree<T>> getChildren()
public String getLabel()
public boolean isLeaf()
Treepublic Tree.Leaf<T> asLeaf()
Treepublic Tree.Branch<T> asBranch()
Treepublic <R> Tree.Branch<R> map(java.util.function.Function<T,R> mapping)
TreeCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.