org.gcube.contentmanagement.gcubedocumentlibrary.streams.adapters
Class AbstractAdapter<FROM,TO,E extends java.lang.Exception>

java.lang.Object
  extended by org.gcube.contentmanagement.gcubedocumentlibrary.streams.adapters.AbstractAdapter<FROM,TO,E>
Type Parameters:
FROM - the type of elements of the underlying stream.
TO - the type of elements of the stream.
E - the type of stream processing faults returned by the adapter.
Direct Known Subclasses:
LocalAdapter, RemoteAdapter

public abstract class AbstractAdapter<FROM,TO,E extends java.lang.Exception>
extends java.lang.Object

Abstract implementation for streams that adapt the elements of RemoteIterator-based streams to other elements of the same or different type.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
AbstractAdapter( rit, Filter<FROM,TO> f, IFaultPolicy<? extends E> h)
          Creates an instance with a RemoteIterator, a Filter, and a IFaultPolicy.
 
Method Summary
 boolean hasNext()
          Returns true if the stream has more elements.
  inner()
          Returns the stream underlying this adapter.
 TO next()
          Returns the next element in the stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAdapter

public AbstractAdapter( rit,
                       Filter<FROM,TO> f,
                       IFaultPolicy<? extends E> h)
Creates an instance with a RemoteIterator, a Filter, and a IFaultPolicy.

Parameters:
rit - the iterator.
f - the filter.
h - the fault handler.
Method Detail

inner

public  inner()
Returns the stream underlying this adapter.

Returns:
the stream.

hasNext

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

Returns:
true if the stream has more elements.

next

public TO next()
        throws E extends java.lang.Exception
Returns the next element in the stream.

Returns:
the next element in the stream.
Throws:
E - if the next element in the stream could not be returned.
E extends java.lang.Exception