story.scheherazade.parameters
Class SCHQueryResultSet

java.lang.Object
  extended by story.scheherazade.parameters.SCHQueryResultSet

public class SCHQueryResultSet
extends java.lang.Object

A collection of SCHQueryResults.

Note that this class is NOT read-only after construction, so calling classes should beware of tampering.

Shamelessly duplicated from QueryResultSet in DBCore, except for certain SCH-specific parts.


Constructor Summary
SCHQueryResultSet()
           
SCHQueryResultSet(Timeline timelineHandler, StoryQuery query, QueryResultSet in)
          Construct a new SCHQueryResultSet object from a DBCore QueryResultSet and the SCHParameters used to issue the query.
 
Method Summary
 void add(SCHQueryResult result)
           
static SCHQueryResultSet dotProduct(SCHQueryResultSet first, SCHQueryResultSet second)
          Create a new SCHQueryResultSet that is a dot product of two other sets, i.e., all the results from the first are combined with all the results from the second, with ordering preserved.
 java.util.Iterator getQueryResults()
          Get an Iterator of the QueryResults.
 SCHQueryResult getResult()
          Get the first result, for an undefined ordering.
 SCHQueryResultSet makeCopy()
          Make a shallow copy of the QueryResultSet.
 int numResults()
          Get the number of results.
 void remove(SCHQueryResult result)
          Remove a SCHQueryResult from the set.
 java.lang.StringBuffer render()
          Render the whole SCHQueryResultSet without references.
 java.lang.StringBuffer render(boolean references)
          Render the whole SCHQueryResultSet.
static SCHQueryResultSet union(SCHQueryResultSet first, SCHQueryResultSet second)
          Create a new QueryResultSet that is a union of two other sets.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCHQueryResultSet

public SCHQueryResultSet()

SCHQueryResultSet

public SCHQueryResultSet(Timeline timelineHandler,
                         StoryQuery query,
                         QueryResultSet in)
                  throws Scheherexception
Construct a new SCHQueryResultSet object from a DBCore QueryResultSet and the SCHParameters used to issue the query. In essence, interprets a QueryResultSet with Scheherazade-level semantics.

Throws:
Scheherexception
Method Detail

add

public void add(SCHQueryResult result)
         throws Scheherexception
Throws:
Scheherexception

remove

public void remove(SCHQueryResult result)
Remove a SCHQueryResult from the set.


getQueryResults

public java.util.Iterator getQueryResults()
Get an Iterator of the QueryResults.


getResult

public SCHQueryResult getResult()
                         throws Scheherexception
Get the first result, for an undefined ordering. In other words, get a result. Throws an exception if there are no results.

Throws:
Scheherexception

numResults

public int numResults()
Get the number of results.


render

public java.lang.StringBuffer render()
                              throws Scheherexception
Render the whole SCHQueryResultSet without references.

Throws:
Scheherexception

render

public java.lang.StringBuffer render(boolean references)
                              throws Scheherexception
Render the whole SCHQueryResultSet.

Parameters:
references - Print reference tables.
Throws:
Scheherexception

dotProduct

public static SCHQueryResultSet dotProduct(SCHQueryResultSet first,
                                           SCHQueryResultSet second)
                                    throws Scheherexception
Create a new SCHQueryResultSet that is a dot product of two other sets, i.e., all the results from the first are combined with all the results from the second, with ordering preserved.

If either of the input sets is empty, the output set is empty. If one set is null and the other is not, the non-null one is returned. If both input sets are null, null is returned.

Throws:
Scheherexception

union

public static SCHQueryResultSet union(SCHQueryResultSet first,
                                      SCHQueryResultSet second)
                               throws Scheherexception
Create a new QueryResultSet that is a union of two other sets.

Throws:
Scheherexception

makeCopy

public SCHQueryResultSet makeCopy()
Make a shallow copy of the QueryResultSet. Does not copy the results themselves, but duplicates pointers to them.



Copyright © 2011 David K. Elson. All Rights Reserved.