org.jrdf.graph.mem
Class TwoFixedIterator

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

public class TwoFixedIterator
extends Object
implements ClosableIterator

An iterator that iterates over a group with a two fixed nodes. Relies on an internal iterator which iterates over all entries in a set, found in a subIndex. The thirdIndexIterator is used to indicate the current position. It will always be set to return the next value until it reaches the end of the group.

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.