Class ResultSetStream

  • All Implemented Interfaces:
    java.util.Iterator<QuerySolution>, ResultSet

    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 Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Model getModel()  
      Model getResourceModel()
      Get the model that resources are created against - may be null
      java.util.List<java.lang.String> getResultVars()
      Get the variable names for the projection
      int 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 java.util.Iterator

        forEachRemaining, remove
    • Constructor Detail

      • ResultSetStream

        public ResultSetStream​(java.util.List<java.lang.String> resultVars,
                               Model m,
                               java.util.Iterator<Binding> iter)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Is there another possibility?
        Specified by:
        hasNext in interface java.util.Iterator<QuerySolution>
        Specified by:
        hasNext in interface ResultSet
      • nextSolution

        public QuerySolution nextSolution()
        Moves onto the next result possibility. The returned object is actual the binding for this result.
        Specified by:
        nextSolution in interface ResultSet
      • 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 interface ResultSet
      • getResultVars

        public java.util.List<java.lang.String> getResultVars()
        Get the variable names for the projection
        Specified by:
        getResultVars in interface ResultSet
      • 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 interface ResultSet