T
- the type of the values of the leaves of the tree.public abstract class AbstractTreeNode<T> extends Object
TreeLeaf
and TreeInternalNode
Constructor and Description |
---|
AbstractTreeNode() |
Modifier and Type | Method and Description |
---|---|
Collection<TreeLeaf<T>> |
getFlatLeaves()
Gets all leaves of this tree node, recursively flattened.
|
static <T,R> R |
walk(AbstractTreeNode<T> tree,
Function<TreeLeaf<T>,R> leafFunction,
BiFunction<Stream<R>,Query.LogicalOperator,R> internalNodeFunction)
Generic helper method to walk a tree (i.e.
|
public AbstractTreeNode()
public static <T,R> R walk(AbstractTreeNode<T> tree, Function<TreeLeaf<T>,R> leafFunction, BiFunction<Stream<R>,Query.LogicalOperator,R> internalNodeFunction)
T
- the type of the values of the leaves of the given treeR
- the type of the object returned by this method.tree
- The tree to walkleafFunction
- The operation to perform for a leafinternalNodeFunction
- The operation to perform for an internal node.
public Collection<TreeLeaf<T>> getFlatLeaves()