net.walend.digraph
Interface EdgeNodeIterator

All Known Subinterfaces:
EdgeIterator
All Known Implementing Classes:
AbstractHashCEDigraph.HashEdgeIterator, AbstractHashGEDigraph.HashEdgeIterator, AbstractHashUEDigraph.HashEdgeIterator

public interface EdgeNodeIterator

EdgeNodeIterator is a special iterator that iterates accross the pairs of nodes that make edges in a digraph.

next() is of type void. Use fromNode() and toNode() to get the fromNode and toNode values for the current edge.

Since:
20010813
Author:
David Walend

Method Summary
 java.lang.Object fromNode()
          Returns the node that his edge begins at.
 boolean hasNext()
          Returns true if there are more edges in this iterator.
 void next()
          Advances to the next edge in the iterator.
 void remove()
          Removes the current edge from the digraph.
 java.lang.Object toNode()
          Returns the node that this edge reaches.
 

Method Detail

hasNext

public boolean hasNext()
Returns true if there are more edges in this iterator.


next

public void next()
Advances to the next edge in the iterator.

Throws:
NoSuchElementException - if the iterator has nothing left.

remove

public void remove()
Removes the current edge from the digraph.

Throws:
java.lang.UnsupportedOperationException - if the digraph is immutable.
java.lang.IllegalStateException - if the next method has not yet been called, or the remove method has already been called after the last call to the next method.

fromNode

public java.lang.Object fromNode()
Returns the node that his edge begins at.

Throws:
java.lang.IllegalStateException - if the next method has not yet been called, or the remove method has already been called after the last call to the next method.

toNode

public java.lang.Object toNode()
Returns the node that this edge reaches.

Throws:
java.lang.IllegalStateException - if the next method has not yet been called, or the remove method has already been called after the last call to the next method.


Copyright (c) 2000, 2001, David Walend