jdsl.graph.api
Interface VertexIterator

All Superinterfaces:
ObjectIterator, PositionIterator
All Known Implementing Classes:
VertexIteratorAdapter

public interface VertexIterator
extends PositionIterator

Iterator over a set of vertices. No order of the vertices is required by this interface, although order may be promised or required by users of the interface. Conceptually, the iterator starts out positioned before the first vertex to be considered. With each call to next(), the iterator skips over another vertex and returns the vertex skipped over, until the iterator is positioned past the last vertex. Note that NoSuchElementException indicates two different failure states: when the iterator is positioned before the first vertex, vertex() and element() fail; when the iterator is positioned after the last vertex, next() fails.

Version:
$Id: VertexIterator.java,v 1.5 1999/08/02 21:19:17 mdh Exp $
Author:
Mark Handy

Method Summary
 Vertex nextVertex()
           
 Vertex vertex()
           
 
Methods inherited from interface jdsl.core.api.PositionIterator
element, nextPosition, position
 
Methods inherited from interface jdsl.core.api.ObjectIterator
hasNext, nextObject, object, reset
 

Method Detail

nextVertex

public Vertex nextVertex()
                  throws java.util.NoSuchElementException
Returns:
Next vertex to consider
Throws:
java.util.NoSuchElementException - if iterator has moved past the last vertex to be seen

vertex

public Vertex vertex()
              throws java.util.NoSuchElementException
Returns:
The vertex returned by the most recent next()
Throws:
java.util.NoSuchElementException - When the iterator is in its initial, before-the-first-vertex state