story.dbcore.parameters
Class QueryResultSet

java.lang.Object
  extended by story.dbcore.parameters.QueryResultSet

public class QueryResultSet
extends java.lang.Object

A collection of QueryResults.

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


Constructor Summary
QueryResultSet()
           
 
Method Summary
 void add(QueryResult result)
           
 void add(QueryResultSet otherResults)
           
static QueryResultSet dotProduct(QueryResultSet first, QueryResultSet second)
          Create a new QueryResultSet 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.
 QueryResult getResult()
          Get the first result, for an undefined ordering.
 QueryResultSet makeCopy()
          Make a shallow copy of the QueryResultSet.
 int numResults()
          Get the number of results.
 void remove(QueryResult result)
          Remove a QueryResult from the set.
 java.lang.StringBuffer render()
          Render the whole QueryResultSet without references.
 java.lang.StringBuffer render(boolean references)
          Render the whole QueryResultSet.
static QueryResultSet union(QueryResultSet first, QueryResultSet 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

QueryResultSet

public QueryResultSet()
Method Detail

add

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

add

public void add(QueryResultSet otherResults)
         throws Scheherexception
Throws:
Scheherexception

remove

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


getQueryResults

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


getResult

public QueryResult 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 QueryResultSet without references.

Throws:
Scheherexception

render

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

Parameters:
references - Print reference tables.
Throws:
Scheherexception

dotProduct

public static QueryResultSet dotProduct(QueryResultSet first,
                                        QueryResultSet second)
                                 throws Scheherexception
Create a new QueryResultSet 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 QueryResultSet union(QueryResultSet first,
                                   QueryResultSet second)
                            throws Scheherexception
Create a new QueryResultSet that is a union of two other sets.

Throws:
Scheherexception

makeCopy

public QueryResultSet 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.