E - the type of stream elementpublic class FoldedStream<E> extends LookAheadStream<E2>
element, hasNext| Constructor and Description |
|---|
FoldedStream(Stream<E> stream,
int foldSize)
Creates an instance with a
Stream and a fold size. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the stream unconditionally, releasing any resources that it may be using.
|
protected boolean |
delegateHasNext()
Returns
true if the underlying stream has more elements. |
protected List<E> |
delegateNext()
Returns an element of the underlying stream
|
boolean |
isClosed()
Returns
true if the stream has been closed. |
URI |
locator()
Returns the stream locator.
|
void |
remove() |
protected Stream<E1> |
stream()
Returns the underlying
Stream. |
hasNext, next, setHandlerpublic FoldedStream(Stream<E> stream, int foldSize) throws IllegalArgumentException
Stream and a fold size.stream - the streamfoldSize - the fault sizeIllegalArgumentException - if the stream is null or the size is not positiveprotected List<E> delegateNext()
LookAheadStreamdelegateNext in class LookAheadStream<List<E>>protected boolean delegateHasNext()
LookAheadStreamtrue if the underlying stream has more elements.delegateHasNext in class LookAheadStream<List<E>>true if the underlying stream has more elementspublic void close()
Stream
Subsequent invocations of this method have no effect.
Subsequents invocations of Stream.hasNext() return false.
Subsequent invocations of Stream.next() throw NoSuchElementExceptions.
Failures are logged by implementations and suppressed otherwise.
public URI locator() throws IllegalStateException
StreamIllegalStateException - if the stream is no longer addressable at the time of invocation.public void remove()
public boolean isClosed()
Streamtrue if the stream has been closed.true if the stream has been closedCopyright © 2016. All Rights Reserved.