com.mhhe.clrs2e
Class AdjacencyMatrixGraph.VertexIterator

java.lang.Object
  |
  +--com.mhhe.clrs2e.AdjacencyMatrixGraph.VertexIterator
All Implemented Interfaces:
java.util.Iterator
Enclosing class:
AdjacencyMatrixGraph

public class AdjacencyMatrixGraph.VertexIterator
extends java.lang.Object
implements java.util.Iterator

Inner class for a vertex iterator.


Field Summary
protected  int lastVisited
          The index of the vertex returned by the most recent call to next.
 
Constructor Summary
AdjacencyMatrixGraph.VertexIterator()
          Starts an iteration through the vertices.
 
Method Summary
 boolean hasNext()
          Returns true if this vertex iterator has more vertices, false otherwise.
 java.lang.Object next()
          Returns the next vertex in the iteration.
 void remove()
          Unsupported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastVisited

protected int lastVisited
The index of the vertex returned by the most recent call to next. Initially, it is -1.

Constructor Detail

AdjacencyMatrixGraph.VertexIterator

public AdjacencyMatrixGraph.VertexIterator()
Starts an iteration through the vertices.

Method Detail

hasNext

public boolean hasNext()
Returns true if this vertex iterator has more vertices, false otherwise.

Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Returns the next vertex in the iteration.

Specified by:
next in interface java.util.Iterator

remove

public void remove()
Unsupported.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - always.