org.jrdf.graph.mem
Class GraphIterator

java.lang.Object
  extended byorg.jrdf.graph.mem.GraphIterator
All Implemented Interfaces:
ClosableIterator, Iterator

public class GraphIterator
extends Object
implements ClosableIterator

An iterator that iterates over an entire graph. Relies on internal iterators which iterate over all entries in the first map, the maps it points to, and the sets they point to. The itemIterator is used to indicate the current position. It will always be set to return the next value until it reaches the end of the graph.

Version:
$Revision: 1.1 $
Author:
Paul Gearon, Andrew Newman

Method Summary
 boolean close()
          Closes the iterator by freeing any resources that it current holds.
 boolean hasNext()
          Returns true if the iteration has more elements.
 Object next()
          Returns the next element in the iteration.
 void remove()
          Implemented for java.util.Iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more elements.

Specified by:
hasNext in interface Iterator
Returns:
true If there is an element to be read.

next

public Object next()
            throws NoSuchElementException
Returns the next element in the iteration.

Specified by:
next in interface Iterator
Returns:
the next element in the iteration.
Throws:
NoSuchElementException - iteration has no more elements.

remove

public void remove()
Implemented for java.util.Iterator.

Specified by:
remove in interface Iterator

close

public boolean close()
Closes the iterator by freeing any resources that it current holds. Nothing to be done for this class.

Specified by:
close in interface ClosableIterator
Returns:
true indicating success.