gr.uoa.di.madgik.grs.reader
Class ForwardReaderIterator<T extends Record>

java.lang.Object
  extended by gr.uoa.di.madgik.grs.reader.ForwardReaderIterator<T>
Type Parameters:
T - The type of Records as defined in the respective ForwardReader
All Implemented Interfaces:
java.util.Iterator<T>

public class ForwardReaderIterator<T extends Record>
extends java.lang.Object
implements java.util.Iterator<T>

An iterator implementing class that can be used to iterate over the Records accessible through a ForwardReader instance

Author:
gpapanikos

Method Summary
 boolean hasNext()
          
 T next()
          
 void remove()
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()

If the status of the reader indicates that there may be more Records available but have not yet reached the current reader through the respective mirroring procedure, then the ForwardReader.waitAvailable(long, java.util.concurrent.TimeUnit) is used with the timeout values defined by ForwardReader.getIteratorTimeout() and ForwardReader.getIteratorTimeUnit()

Specified by:
hasNext in interface java.util.Iterator<T extends Record>
See Also:
Iterator.hasNext()

next

public T next()

the ForwardReader.get(long, java.util.concurrent.TimeUnit) method is used to retrieve the next available Record. The timeout values used are the ones defined by ForwardReader.getIteratorTimeout() and ForwardReader.getIteratorTimeUnit(). in case there is some error during the Record retrieval or the timeout expired, null is returned

Specified by:
next in interface java.util.Iterator<T extends Record>
See Also:
Iterator.next()

remove

public void remove()

Operation is not supported. An IllegalStateException is thrown upon invocation

Specified by:
remove in interface java.util.Iterator<T extends Record>
See Also:
Iterator.remove()