java.lang.Object
org.apache.jena.sparql.engine.ResultSetStream
- All Implemented Interfaces:
Iterator<QuerySolution>
,ResultSet
- Direct Known Subclasses:
ResultSetAdapter
The main ResultSet implementation for returning results from queries.
This version is "use once" - you can not reset the result set because
the results of the query are not remembered so as not to consume potentially
large amounts of memory.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static ResultSet
Create a streaming ResultSet, with resources sharing a common Modelstatic ResultSet
Create aResultSet
from a List<Var> and an Iterator<Binding>.void
forEachRemaining
(Consumer<? super QuerySolution> action) org.apache.jena.rdf.model.Model
getModel()
org.apache.jena.rdf.model.Model
Get the model that resources are created against - may be nullGet the variable names for the projectionint
Return the "row number" - a count of the number of possibilities returned so far.boolean
hasNext()
Is there another possibility?next()
Moves onto the next result possibility.Move to the next binding (low level)Moves onto the next result possibility.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jena.query.ResultSet
materialise, rewindable
-
Method Details
-
create
public static ResultSet create(List<String> resultVars, org.apache.jena.rdf.model.Model m, Iterator<Binding> iter) Create a streaming ResultSet, with resources sharing a common Model -
create
Create aResultSet
from a List<Var> and an Iterator<Binding>. -
hasNext
public boolean hasNext()Is there another possibility?- Specified by:
hasNext
in interfaceIterator<QuerySolution>
- Specified by:
hasNext
in interfaceResultSet
-
nextBinding
Description copied from interface:ResultSet
Move to the next binding (low level)- Specified by:
nextBinding
in interfaceResultSet
-
close
public void close() -
nextSolution
Moves onto the next result possibility. The returned object is actual the binding for this result.- Specified by:
nextSolution
in interfaceResultSet
-
next
Moves onto the next result possibility.- Specified by:
next
in interfaceIterator<QuerySolution>
- Specified by:
next
in interfaceResultSet
-
forEachRemaining
- Specified by:
forEachRemaining
in interfaceIterator<QuerySolution>
- Specified by:
forEachRemaining
in interfaceResultSet
-
getRowNumber
public int getRowNumber()Return the "row number" - a count of the number of possibilities returned so far. Remains valid (as the total number of possibilities) after the iterator ends.- Specified by:
getRowNumber
in interfaceResultSet
-
getResultVars
Get the variable names for the projection- Specified by:
getResultVars
in interfaceResultSet
-
getModel
public org.apache.jena.rdf.model.Model getModel() -
getResourceModel
public org.apache.jena.rdf.model.Model getResourceModel()Description copied from interface:ResultSet
Get the model that resources are created against - may be null- Specified by:
getResourceModel
in interfaceResultSet
-