com.phoenixst.plexus.traversals

Class Walker

public class Walker extends Object implements Traverser

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.

Since: 1.0

Version: $Revision: 1.9 $

Author: Ray A. Conner

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.EdgegetEdge()
booleanhasNext()
Objectnext()
voidremove()
Removes from the underlying Graph the last node returned by Walker, effectively terminating this iteration.
voidremoveEdge()

Constructor Detail

Walker

public Walker(Object startNode, Graph graph, Predicate traverserPredicate)
Creates a new Walker.

Walker

public Walker(Object startNode, OrientedForest forest)
Creates a new unmodifiable Walker, which traverses the ancestors of the specified startNode.

Walker

public Walker(Object startNode, Transformer incidentEdgeGetter)
Creates a new unmodifiable Walker.

Walker

public Walker(Object startNode, Graph graph, Transformer incidentEdgeGetter)
Creates a new Walker. If the graph argument is null, the Walker will be unmodifiable.

Method Detail

getEdge

public Graph.Edge getEdge()

hasNext

public boolean hasNext()

next

public Object next()

remove

public void remove()
Removes from the underlying Graph the last node returned by Walker, effectively terminating this iteration.

Description copied from interface: java.util.Iterator
{@inheritDoc }

removeEdge

public void removeEdge()
See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.