com.hp.hpl.jena.rdql
Class QueryResultsMem

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

public class QueryResultsMem
extends java.lang.Object
implements QueryResultsRewindable

Version:
$Id: QueryResultsMem.java,v 1.8 2003/07/15 13:26:58 andy_seaborne Exp $
Author:
Andy Seaborne

Constructor Summary
QueryResultsMem(Model model)
          Prcoess a result set encoded in RDF according to http://jena.hpl.hp.com/2003/03/result-set#
QueryResultsMem(QueryResults qr)
          Create an in-memory result set from any QueryResults object.
QueryResultsMem(QueryResultsMem imrs2)
          Create an in-memory result set from another one
QueryResultsMem(QueryResultsMem imrs2, boolean takeCopy)
          Create an in-memory result set from another one
QueryResultsMem(java.lang.String urlStr)
          Read in a result set encoded in RDF according to http://jena.hpl.hp.com/2003/03/result-set#
 
Method Summary
 Resource asRDF(Model model)
          Encode the result set as RDF in the model provided.
 void close()
          Close the results set.
static boolean equivalent(QueryResultsMem irs1, QueryResultsMem irs2)
          Are two result sets the same (isomorphic)?
 java.util.List getAll()
          Deprecated. Old QueryResults operation
 java.util.List getResultVars()
          Get the variable names for the projection
 int getRowNumber()
          Return the "row" number for the current iterator item
 boolean hasNext()
          Is there another possibility?
 void list(java.io.PrintWriter pw)
          Print out the result set in dump format.
 java.lang.Object next()
          Moves onto the next result possibility.
 void remove()
           
 void reset()
           
 void rewind()
          Move back to the start of the iterator for this instance of results of a query.
 int size()
          Return the number of rows
 Model toModel()
          Encode the result set as RDF.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResultsMem

public QueryResultsMem(QueryResultsMem imrs2)
Create an in-memory result set from another one

Parameters:
imrs2 - The other QueryResultsMem object

QueryResultsMem

public QueryResultsMem(QueryResultsMem imrs2,
                       boolean takeCopy)
Create an in-memory result set from another one

Parameters:
imrs2 - The other QueryResultsMem object
takeCopy - Should we copy the rows?

QueryResultsMem

public QueryResultsMem(QueryResults qr)
Create an in-memory result set from any QueryResults object. If the QueryResults is an in-memory one already, then no copying is done - the necessary internal datastructures are shared. This operation destroys (uses up) a QueryResults object that is not an in memory one.


QueryResultsMem

public QueryResultsMem(Model model)
Prcoess a result set encoded in RDF according to http://jena.hpl.hp.com/2003/03/result-set#

Parameters:
model -

QueryResultsMem

public QueryResultsMem(java.lang.String urlStr)
                throws java.io.FileNotFoundException
Read in a result set encoded in RDF according to http://jena.hpl.hp.com/2003/03/result-set#

Parameters:
urlStr - URL string
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 should be of class ResultBinding

Specified by:
next in interface QueryResults

close

public void close()
Close the results set. Should be called on all QueryResults objects

Specified by:
close in interface QueryResults

rewind

public void rewind()
Description copied from interface: QueryResultsRewindable
Move back to the start of the iterator for this instance of results of a query.

Specified by:
rewind in interface QueryResultsRewindable

reset

public void reset()

getRowNumber

public int getRowNumber()
Return the "row" number for the current iterator item

Specified by:
getRowNumber in interface QueryResults

size

public int size()
Return the number of rows


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. Old QueryResults operation

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

Specified by:
getAll in interface QueryResults
Returns:
List

equivalent

public static boolean equivalent(QueryResultsMem irs1,
                                 QueryResultsMem irs2)
Are two result sets the same (isomorphic)?

Parameters:
irs1 -
irs2 -
Returns:
boolean

toModel

public Model toModel()
Encode the result set as RDF.

Returns:
Model Model contains the results

asRDF

public Resource asRDF(Model model)
Encode the result set as RDF in the model provided.

Parameters:
model - The place where to put the RDF.
Returns:
Resource The resource for the result set.

list

public void list(java.io.PrintWriter pw)
Print out the result set in dump format. Easeier to read than computed N3



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