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

java.lang.Object
  extended by org.gcube.contentmanagement.gcubedocumentlibrary.streams.folding.FoldingAbstractAdapter<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:
FoldingLocalAdapter, FoldingRemoteAdapter

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

Abstract implementation for streams that adapt the elements of RemoteIterator-based streams by folding them into Lists of the same or different type.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
FoldingAbstractAdapter( rit, Filter<FROM,TO> f, IFaultPolicy<? extends E> h, int s)
          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.
 java.util.List<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

FoldingAbstractAdapter

public FoldingAbstractAdapter( rit,
                              Filter<FROM,TO> f,
                              IFaultPolicy<? extends E> h,
                              int s)
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 java.util.List<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