jdsl.graph.api
Interface EdgeIterator

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

public interface EdgeIterator
extends PositionIterator

Iterator over a set of edges. No order of the edges 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 edge to be considered. With each call to next(), the iterator skips over another edge and returns the edge skipped over, until the iterator is positioned past the last edge. Note that NoSuchElementException indicates two different failure states: when the iterator is positioned before the first edge, edge() and element() fail; when the iterator is positioned after the last edge, next() fails.

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

Method Summary
 Edge edge()
           
 Edge nextEdge()
           
 
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

nextEdge

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

edge

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