Package org.apache.jena.sparql.engine
Class ResultSetStream
- java.lang.Object
-
- org.apache.jena.sparql.engine.ResultSetStream
-
- All Implemented Interfaces:
java.util.Iterator<QuerySolution>
,ResultSet
- Direct Known Subclasses:
ResultSetAdapter
public class ResultSetStream extends java.lang.Object implements ResultSet
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.
-
-
Constructor Summary
Constructors Constructor Description ResultSetStream(java.util.List<java.lang.String> resultVars, Model m, java.util.Iterator<Binding> iter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static ResultSet
create(java.util.List<java.lang.String> resultVars, Model m, java.util.Iterator<Binding> iter)
Create a streaming ResultSet, with resources sharing a common Modelstatic ResultSet
create(java.util.List<Var> resultVars, java.util.Iterator<Binding> iter)
Create aResultSet
from a List<Var> and an Iterator<Binding>.Model
getModel()
Model
getResourceModel()
Get the model that resources are created against - may be nulljava.util.List<java.lang.String>
getResultVars()
Get the variable names for the projectionint
getRowNumber()
Return the "row number" - a count of the number of possibilities returned so far.boolean
hasNext()
Is there another possibility?QuerySolution
next()
Moves onto the next result possibility.Binding
nextBinding()
Move to the next binding (low level)QuerySolution
nextSolution()
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 Detail
-
create
public static ResultSet create(java.util.List<java.lang.String> resultVars, Model m, java.util.Iterator<Binding> iter)
Create a streaming ResultSet, with resources sharing a common Model
-
create
public static ResultSet create(java.util.List<Var> resultVars, java.util.Iterator<Binding> iter)
Create aResultSet
from a List<Var> and an Iterator<Binding>.
-
hasNext
public boolean hasNext()
Is there another possibility?- Specified by:
hasNext
in interfacejava.util.Iterator<QuerySolution>
- Specified by:
hasNext
in interfaceResultSet
-
nextBinding
public Binding nextBinding()
Description copied from interface:ResultSet
Move to the next binding (low level)- Specified by:
nextBinding
in interfaceResultSet
-
nextSolution
public QuerySolution nextSolution()
Moves onto the next result possibility. The returned object is actual the binding for this result.- Specified by:
nextSolution
in interfaceResultSet
-
next
public QuerySolution next()
Moves onto the next result possibility.- Specified by:
next
in interfacejava.util.Iterator<QuerySolution>
- Specified by:
next
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
public java.util.List<java.lang.String> getResultVars()
Get the variable names for the projection- Specified by:
getResultVars
in interfaceResultSet
-
getModel
public Model getModel()
-
getResourceModel
public Model getResourceModel()
Description copied from interface:ResultSet
Get the model that resources are created against - may be null- Specified by:
getResourceModel
in interfaceResultSet
-
-