T
- the type of node in the graphpublic class AcyclicDepthFirstPostOrderTraversalWithPayload<T,P> extends Object
If a cycle is encountered, a CycleException
is thrown by traverse(Iterable)
.
Constructor and Description |
---|
AcyclicDepthFirstPostOrderTraversalWithPayload(GraphTraversableWithPayload<T,P> traversable) |
Modifier and Type | Method and Description |
---|---|
Iterable<Pair<T,P>> |
traverse(Iterable<? extends T> initialNodes)
Performs a depth-first, post-order traversal over a DAG.
|
Iterable<Pair<T,P>> |
traverse(Iterable<? extends T> initialNodes,
java.util.function.Predicate<T> shouldExploreChildren)
Performs a depth-first, post-order traversal over a DAG.
|
public AcyclicDepthFirstPostOrderTraversalWithPayload(GraphTraversableWithPayload<T,P> traversable)
public Iterable<Pair<T,P>> traverse(Iterable<? extends T> initialNodes) throws CycleException
initialNodes
- The nodes from which to perform the traversal. Not allowed to contain
null
.CycleException
- if a cycle is found while performing the traversal.public Iterable<Pair<T,P>> traverse(Iterable<? extends T> initialNodes, java.util.function.Predicate<T> shouldExploreChildren) throws CycleException
initialNodes
- The nodes from which to perform the traversal. Not allowed to contain
null
.shouldExploreChildren
- Whether or not to explore a particular node's children. Used to
support short circuiting in the traversal.CycleException
- if a cycle is found while performing the traversal.