nz.ac.waikato.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:
JDSL 2.1.1
Author:
Mark Handy

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

Method Detail

nextVertex

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

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


Copyright © 2009 ModelJUnit Project. All Rights Reserved.