com.hp.hpl.jena.rdql
Class QueryResultsStream

java.lang.Object
  extended bycom.hp.hpl.jena.rdql.QueryResultsStream
All Implemented Interfaces:
java.util.Iterator, QueryResults

public class QueryResultsStream
extends java.lang.Object
implements QueryResults

The main QueryResults implementation for returning results from queries. This version is "use once" - you can not reset the result set because the resulys of the query are not remembered so as not to consume potentially large amounts of memory.

Version:
$Id: QueryResultsStream.java,v 1.4 2003/04/08 22:12:03 ian_dickinson Exp $
Author:
Andy Seaborne
See Also:
Query, QueryEngine, ResultBinding, QueryResultsStream

Constructor Summary
QueryResultsStream(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()
          Deprecated. QueryResultsStream do not have all the results at once - QueryResultsMem
 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

QueryResultsStream

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

remove

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

hasNext

public boolean hasNext()
Is there another possibility?

Specified by:
hasNext in interface QueryResults

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 QueryResults

close

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

Specified by:
close in interface QueryResults

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.

Specified by:
getRowNumber in interface QueryResults

getResultVars

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

Specified by:
getResultVars in interface QueryResults

getAll

public java.util.List getAll()
Deprecated. QueryResultsStream do not have all the results at once - QueryResultsMem

Convenience function to consume a query. Returns a list of ResultBindings.

Specified by:
getAll in interface QueryResults
Returns:
List


Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.