JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.graph
Class VertexAndTrailIterator

java.lang.Object
  extended bygov.nasa.javaGenes.graph.VertexAndTrailIterator

public class VertexAndTrailIterator
extends java.lang.Object

This iterator will return each vertex in g starting with the neighbors of v using a breadth first search. Along with each vertex will be the shortest trail to it from v. In cases where there are more than one shortest trail to a vertex, that vertex will be returned once for each shortest trail along with the appropriate trail.

See Also:
Graph, Trail

Constructor Summary
VertexAndTrailIterator(Graph g, Vertex v)
           
 
Method Summary
 boolean more()
           
 void next()
          move to the next trail
 Trail trail()
           
 Vertex vertex()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VertexAndTrailIterator

public VertexAndTrailIterator(Graph g,
                              Vertex v)
Parameters:
g - the graph to find trails in
v - the vertex to start from (starts every trail)
Method Detail

more

public boolean more()
Returns:
true if there are any more trails to iterate over

next

public void next()
move to the next trail


vertex

public Vertex vertex()
Returns:
the current vertex

trail

public Trail trail()
Returns:
the current trail

JavaGenes, NASA Ames. Written largely by Al Globus