public class JBTreeTraverser<T> extends FilteredTraverserBase<T,JBTreeTraverser<T>>
FilteredTraverserBase.EdgeFilter<T>, FilteredTraverserBase.Meta<T>
Modifier | Constructor and Description |
---|---|
protected |
JBTreeTraverser(FilteredTraverserBase.Meta<T> meta) |
|
JBTreeTraverser(Function<? super T,? extends java.lang.Iterable<? extends T>> treeStructure) |
Modifier and Type | Method and Description |
---|---|
static <T> JBTreeTraverser<T> |
from(Function<? super T,? extends java.lang.Iterable<? extends T>> treeStructure) |
<S> JBTreeTraverser<S> |
map(Function<? super T,? extends S> function)
Returns a
JBTreeTraverser that applies function to each element of this traverser. |
<S> JBTreeTraverser<S> |
map(Function<? super T,? extends S> function,
Function<? super S,? extends T> reverse)
Returns a
JBTreeTraverser that applies function to each element of this traverser. |
protected JBTreeTraverser<T> |
newInstance(FilteredTraverserBase.Meta<T> meta) |
static <T> JBTreeTraverser<T> |
of(Function<? super T,T[]> treeStructure) |
bfsTraversal, biOrderDfsTraversal, cached, children, expand, expandAndFilter, expandAndSkip, filter, filter, forceDisregard, forceIgnore, getRoot, getRoots, getTree, interceptTraversal, iterator, mapImpl, mapImpl, onRange, postOrderDfsTraversal, preOrderDfsTraversal, regard, reset, toList, toSet, toString, tracingBfsTraversal, traverse, traverse, unique, unique, withRoot, withRoots, withRoots, withTraversal
public JBTreeTraverser(Function<? super T,? extends java.lang.Iterable<? extends T>> treeStructure)
protected JBTreeTraverser(FilteredTraverserBase.Meta<T> meta)
public static <T> JBTreeTraverser<T> from(Function<? super T,? extends java.lang.Iterable<? extends T>> treeStructure)
public static <T> JBTreeTraverser<T> of(Function<? super T,T[]> treeStructure)
protected JBTreeTraverser<T> newInstance(FilteredTraverserBase.Meta<T> meta)
newInstance
in class FilteredTraverserBase<T,JBTreeTraverser<T>>
public final <S> JBTreeTraverser<S> map(Function<? super T,? extends S> function, Function<? super S,? extends T> reverse)
JBTreeTraverser
that applies function
to each element of this traverser.
A reverse transform is required if available, otherwise use map(Function)
.public final <S> JBTreeTraverser<S> map(Function<? super T,? extends S> function)
JBTreeTraverser
that applies function
to each element of this traverser.
The required reverse transform, a hash map, is built internally while traversing.
Prefer map(Function, Function)
if a cheap reverse transform is available.