org.gcube.contentmanagement.contentmanager.stubs.calls.iterators
Class RSIterator<T>

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.calls.iterators.BaseRSIterator<T>
      extended by org.gcube.contentmanagement.contentmanager.stubs.calls.iterators.RSIterator<T>
All Implemented Interfaces:
RemoteIterator<T>
Direct Known Subclasses:
GDocRSIterator

public class RSIterator<T>
extends BaseRSIterator<T>

A RemoteIterator over a result set with an embedded ResultParser.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
RSIterator(java.net.URI l, ResultParser<T> p)
          Creates an instance with a result set locator and a result parser.
RSIterator(java.net.URI l, ResultParser<T> p, int timeout)
          Creates an instance with a result set locator, a result parser, and a read timeout.
 
Method Summary
 boolean hasNext()
          Indicates whether there are more elements to iterate over.
 T next()
          Returns the next element.
 
Methods inherited from class org.gcube.contentmanagement.contentmanager.stubs.calls.iterators.BaseRSIterator
close, getRSIterator, locator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSIterator

public RSIterator(java.net.URI l,
                  ResultParser<T> p)
           throws java.lang.Exception
Creates an instance with a result set locator and a result parser.

Parameters:
l - the locator.
p - the parser.
Throws:
java.lang.Exception - if the result set could not be accessed from the locator.

RSIterator

public RSIterator(java.net.URI l,
                  ResultParser<T> p,
                  int timeout)
           throws java.lang.Exception
Creates an instance with a result set locator, a result parser, and a read timeout.

Parameters:
l - the locator.
p - the parser.
timeout - the timeout, in seconds.
Throws:
java.lang.Exception - if the result set could not be accessed from the locator.
Method Detail

hasNext

public boolean hasNext()
Indicates whether there are more elements to iterate over.

Returns:
true if there are more elements, false otherwise.

next

public T next()
       throws java.lang.Exception,
              java.util.NoSuchElementException
Returns the next element.

Returns:
the element.
Throws:
java.lang.Exception - if the element could not be returned.
java.util.NoSuchElementException - if there are no further elements to iterate over.