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

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.calls.iterators.RSCollection<T>
All Implemented Interfaces:
java.lang.Iterable<T>
Direct Known Subclasses:
GDocRSCollection, NodeRSCollection

public class RSCollection<T>
extends java.lang.Object
implements java.lang.Iterable<T>

A lazy collection backed by a result set that can be iterated over with an AsyncRSIterator.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
RSCollection(java.net.URI l, ResultParser<T> p)
          Creates an instance with a result set locator and a result parser.
RSCollection(java.net.URI l, ResultParser<T> p, FaultListener fl)
          Creates an instance with a result set locator, a result parser, and a fault listener.
RSCollection(java.net.URI l, ResultParser<T> p, int timeout)
          Creates an instance with a result set locator, a result parser, and a read timeout.
RSCollection(java.net.URI l, ResultParser<T> p, int timeout, FaultListener fl)
          Creates an instance with a result set locator, a result parser, a read timeout, and a fault listener.
 
Method Summary
 java.net.URI getLocator()
          Returns the result set locator of the underlying ResultSet.
 java.util.Iterator<T> iterator()
          
 void setListener(FaultListener fl)
          Sets a listener for iteration faults.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSCollection

public RSCollection(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.

RSCollection

public RSCollection(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.

RSCollection

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

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

RSCollection

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

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

getLocator

public java.net.URI getLocator()
Returns the result set locator of the underlying ResultSet.

Returns:
the locator.

setListener

public void setListener(FaultListener fl)
Sets a listener for iteration faults.

Parameters:
fl - the listener.

iterator

public java.util.Iterator<T> iterator()
                               throws java.lang.RuntimeException

Specified by:
iterator in interface java.lang.Iterable<T>
Throws:
java.lang.RuntimeException