com.phoenixst.plexus.traversals
public class Walker extends Object implements Traverser
Traverser
which walks a graph, with no cycle
detection. Each iteration step moves from one node to an adjacent
node. The first node returned is the start node, and no
Edge
is traversed to reach it.
Since: 1.0
Version: $Revision: 1.9 $
Constructor Summary | |
---|---|
Walker(Object startNode, Graph graph, Predicate traverserPredicate)
Creates a new Walker . | |
Walker(Object startNode, OrientedForest forest)
Creates a new unmodifiable Walker , which
traverses the ancestors of the specified
startNode . | |
Walker(Object startNode, Transformer incidentEdgeGetter)
Creates a new unmodifiable Walker . | |
Walker(Object startNode, Graph graph, Transformer incidentEdgeGetter)
Creates a new Walker . |
Method Summary | |
---|---|
Graph.Edge | getEdge() |
boolean | hasNext() |
Object | next() |
void | remove()
Removes from the underlying Graph the last node
returned by Walker, effectively terminating this
iteration.
|
void | removeEdge() |
Walker
.Walker
, which
traverses the ancestors of the specified
startNode
.Walker
.Walker
. If the graph
argument is null
, the Walker
will be
unmodifiable.Graph
the last node
returned by Walker, effectively terminating this
iteration.
Description copied from interface: java.util.Iterator
{@inheritDoc }