public interface QueryResult<T> extends Iterator<T>, AutoCloseable
The results of executing a Query
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the query results and return any resources in use back to the system.
|
boolean |
hasNext() |
default Options |
metadata()
Return any metadata associated with the query results, such as runtime, number of results, etc.
|
T |
next() |
default Stream<T> |
stream()
Return the results as a
Stream. |
forEachRemaining, remove@Nonnull default Options metadata()
void close()
close in interface AutoCloseableRuntimeException - if there was a fatal error while closingboolean hasNext()
T next()
next in interface Iterator<T>IllegalStateException - if the results have been closeddefault Stream<T> stream()
Stream. The `Stream` *must be* closed when no longer
in use so that the results are closed. Optionally, the caller can close the results directly after using the
`Stream`.IllegalStateException - Obtaining the stream, or iterating through the stream can throw this exception of the underlying
results are closed at any time.ClosingSpliterator to *auto-close* these results when the
last item is iterated over in an effort to help users who are forgetful about closing Streams since
that is not common.Copyright © 2010-2016 Stardog Union. All Rights Reserved.