Package org.eclipse.rdf4j.query
Interface QueryResult<T>
- All Superinterfaces:
AutoCloseable
,CloseableIteration<T>
,Iterable<T>
,Iterator<T>
- All Known Subinterfaces:
GraphQueryResult
,TupleQueryResult
- All Known Implementing Classes:
BackgroundGraphResult
,BackgroundTupleResult
,CachedGraphQueryResult
,CachedTupleQueryResult
,CleanerGraphQueryResult
,CleanerTupleQueryResult
,GraphQueryResultImpl
,IteratingGraphQueryResult
,IteratingTupleQueryResult
,MutableTupleQueryResult
,ReusableGraphQueryResult
,ReusableTupleQueryResult
,TupleQueryResultImpl
Super type of all query result types (TupleQueryResult, GraphQueryResult, etc.).
- Author:
- Jeen Broekstra, Arjohn Kampman
-
Method Summary
Methods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
close
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Method Details
-
iterator
-
hasNext
Returnstrue
if the query result has more elements. (In other words, returnstrue
ifnext()
would return an element rather than throwing aNoSuchElementException
.)- Specified by:
hasNext
in interfaceIterator<T>
- Returns:
true
if the iteration has more elements.- Throws:
QueryEvaluationException
- if an error occurs while executing the query.
-
next
Returns the next element in the query result.- Specified by:
next
in interfaceIterator<T>
- Returns:
- the next element in the query result.
- Throws:
NoSuchElementException
- if the iteration has no more elements or if it has been closed.QueryEvaluationException
- if an error occurs while executing the query.
-
stream
Convert the result elements to a JavaStream
. Note that the consumer should take care to close the stream (by calling Stream#close() or using try-with-resource) if it is not fully consumed.- Specified by:
stream
in interfaceCloseableIteration<T>
- Returns:
- stream a
Stream
of query result elements.
-