com.hp.hpl.jena.rdf.query
Class QueryResults

java.lang.Object
  |
  +--com.hp.hpl.jena.rdf.query.QueryResults
All Implemented Interfaces:
java.util.Iterator

public class QueryResults
extends java.lang.Object
implements java.util.Iterator

Results from a query in a "ResultSet"-like manner. Each row corresponds to a set of bindings which fulfil the conditions of the query. Access to the results is by variable name.

See Also:
Query, QueryEngine

Constructor Summary
QueryResults(Query query, QueryExecution qe, java.util.Iterator iter)
           
 
Method Summary
 void close()
          Close the results iterator and stop query evaluation as soon as convenient.
 java.util.List getAll()
          Convenience function to consume a query.
 java.lang.String getBinding(java.lang.String name)
          Access a binding (a mapping from variable name to value).
 java.util.List 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?
 java.lang.Object next()
          Moves onto the next result possibility.
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResults

public QueryResults(Query query,
                    QueryExecution qe,
                    java.util.Iterator iter)
Method Detail

remove

public void remove()
            throws java.lang.UnsupportedOperationException
Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - Always thrown.

hasNext

public boolean hasNext()
Is there another possibility?
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Moves onto the next result possibility. The returned object is actual the binding for this result; it is possible to access the bound variables for the current possibility through the additional variable accessor opertations.
Specified by:
next in interface java.util.Iterator

close

public void close()
Close the results iterator and stop query evaluation as soon as convenient.

getBinding

public java.lang.String getBinding(java.lang.String name)
Access a binding (a mapping from variable name to value). RDF does not explicitly type values so we only provide a string form and leave it to the application context to interpret as an integer, date etc.

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.

getResultVars

public java.util.List getResultVars()
Get the variable names for the projection

getAll

public java.util.List getAll()
Convenience function to consume a query. Returns a list of ResultBindings.


Copyright © 2001 Hewlett-Packard. All Rights Reserved.