E1 - the type of elements of the input streamE2 - the type of stream elementspublic class UnfoldedStream<E1,E2> extends LookAheadStream<E2>
element, hasNext| Constructor and Description |
|---|
UnfoldedStream(Stream<E1> stream,
Generator<E1,Stream<E2>> generator)
|
| 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 E2 |
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 UnfoldedStream(Stream<E1> stream, Generator<E1,Stream<E2>> generator) throws IllegalArgumentException
stream - the streamgenerator - the generatorIllegalArgumentException - if the stream or the generator are nullprotected E2 delegateNext()
LookAheadStreamdelegateNext in class LookAheadStream<E2>protected boolean delegateHasNext()
LookAheadStreamtrue if the underlying stream has more elements.delegateHasNext in class LookAheadStream<E2>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 © 2019. All Rights Reserved.