|
Plexus v0.13.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenixst.plexus.traversals.Walker
public class Walker
A 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.
| Constructor Summary | |
|---|---|
Walker(Object startNode,
Graph graph,
org.apache.commons.collections.Predicate traverserPredicate)
Creates a new Walker. |
|
Walker(Object startNode,
Graph graph,
org.apache.commons.collections.Transformer incidentEdgeGetter)
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,
org.apache.commons.collections.Transformer incidentEdgeGetter)
Creates a new unmodifiable Walker. |
|
| Method Summary | |
|---|---|
Graph.Edge |
getEdge()
Returns the Edge which was traversed to get to
the last node returned by next(), or
null if no Edge was traversed. |
boolean |
hasNext()
|
Object |
next()
|
void |
remove()
Removes from the underlying Graph the last node
returned by next(), effectively terminating this
iteration. |
void |
removeEdge()
Removes from the underlying Graph the
Edge that would be returned by getEdge() (optional operation). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Walker(Object startNode,
Graph graph,
org.apache.commons.collections.Predicate traverserPredicate)
Walker.
public Walker(Object startNode,
OrientedForest forest)
Walker, which
traverses the ancestors of the specified
startNode.
public Walker(Object startNode,
org.apache.commons.collections.Transformer incidentEdgeGetter)
Walker.
public Walker(Object startNode,
Graph graph,
org.apache.commons.collections.Transformer incidentEdgeGetter)
Walker. If the graph
argument is null, the Walker will be
unmodifiable.
| Method Detail |
|---|
public boolean hasNext()
hasNext in interface Iteratorpublic Object next()
next in interface Iteratorpublic void remove()
Graph the last node
returned by next(), effectively terminating this
iteration.
Description copied from interface: Iterator
remove in interface Iteratorpublic Graph.Edge getEdge()
TraverserEdge which was traversed to get to
the last node returned by next(), or
null if no Edge was traversed. This
call can be made only if remove() or removeEdge() has not been called after the last
call to next().
getEdge in interface TraverserEdge which was traversed to get to
the last node returned by next(), or
null if no Edge was traversed.public void removeEdge()
TraverserGraph the
Edge that would be returned by getEdge() (optional operation). If no Edge was
traversed (as in the root of a breadth-first search), this
method throws a IllegalStateException. This
method can be called only once per call to next(). The behavior of a traverser is unspecified if the
underlying graph structure is modified while the traversal is
in progress in any way other than by calling this method or
remove().
removeEdge in interface Traverser
|
Plexus v0.13.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||