public class ResultsetStream<E extends gr.uoa.di.madgik.grs.record.Record> extends LookAheadStream<E>
Stream adapter for gRS2 resultsets.
This implementation is not thread safe.
| Modifier and Type | Field and Description |
|---|---|
static int |
default_timeout |
static TimeUnit |
default_timeout_unit |
element, hasNext| Constructor and Description |
|---|
ResultsetStream(URI locator)
Creates a new instance with a result set locator.
|
| 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 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() |
void |
setTimeout(long timeout,
TimeUnit unit) |
hasNext, next, setHandlerpublic static final int default_timeout
public static final TimeUnit default_timeout_unit
public ResultsetStream(URI locator) throws IllegalArgumentException
locator - the locator.IllegalArgumentException - if the locator is null.public void setTimeout(long timeout,
TimeUnit unit)
throws IllegalArgumentException
IllegalArgumentExceptionprotected E delegateNext()
LookAheadStreamdelegateNext in class LookAheadStream<E extends gr.uoa.di.madgik.grs.record.Record>protected boolean delegateHasNext()
LookAheadStreamtrue if the underlying stream has more elements.delegateHasNext in class LookAheadStream<E extends gr.uoa.di.madgik.grs.record.Record>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 © 2018. All Rights Reserved.