E - the type of stream elementspublic abstract class LookAheadStream<E> extends Object implements Stream<E>
Stream implementation based on look-ahead operations over an underlying stream.
The implementation attempts to prefetch the output of next() in hasNext(). If a failure occurs,
hasNext():
StreamSkipSignal;
FaultHandler for all the other failures. If the FaultHandler re-throws the same or a
different exception, the implementation throws it at the following next().| Modifier and Type | Field and Description |
|---|---|
protected org.gcube.data.streams.LookAheadStream.NullOr<E> |
element |
protected Boolean |
hasNext |
| Constructor and Description |
|---|
LookAheadStream() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
delegateHasNext()
Returns
true if the underlying stream has more elements. |
protected abstract E |
delegateNext()
Returns an element of the underlying stream
|
boolean |
hasNext() |
E |
next() |
void |
setHandler(FaultHandler handler)
Sets the
FaultHandler for the iteration |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removeprotected Boolean hasNext
protected org.gcube.data.streams.LookAheadStream.NullOr<E> element
public void setHandler(FaultHandler handler) throws IllegalArgumentException
FaultHandler for the iterationhandler - the handlerIllegalArgumentException - if the handler is nullpublic final boolean hasNext()
public final E next()
protected abstract E delegateNext()
protected abstract boolean delegateHasNext()
true if the underlying stream has more elements.true if the underlying stream has more elementsCopyright © 2017. All Rights Reserved.