com.waveset.object
Class QueryResultAdapter

java.lang.Object
  extended bycom.waveset.object.QueryResultAdapter
All Implemented Interfaces:
QueryResult

public class QueryResultAdapter
extends java.lang.Object
implements QueryResult

Wraps the older RepositoryResult object and provides an implementation of the newer simpler QueryResult interface. The wrapper is necessary because the return value of the next() method is different.

Can also wrap a simple List of objects, such as those returned by ObjectCache.


Field Summary
static java.lang.String code_id
           
 
Constructor Summary
QueryResultAdapter()
          Create an empty result object.
QueryResultAdapter(java.util.List objects)
           
QueryResultAdapter(RepositoryResult rr)
           
 
Method Summary
 RepositoryResult getRepositoryResult()
           
 int getRowCount()
          Return the number of rows in the result (or -1 if unknown).
 boolean hasNext()
          Returns true if there is another row in the result.
 void merge(QueryResultAdapter s, int limit, java.util.Set dupsMap)
           
 void merge(QueryResultAdapter s, int limit, java.util.Set dupsMap, RepositoryResult.RowMerger rowMerger)
           
 QueryResultRow next()
          Returns the next row in the result.
 void remove()
          Removes the current row from the result.
 void resetIteration()
          Seeks to the first row in the result.
 java.util.List toList()
          Returns all of the results as a list.
 java.util.List toList(java.lang.String attname)
          Returns all values of one attribute in the result as a list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

QueryResultAdapter

public QueryResultAdapter()
Create an empty result object.


QueryResultAdapter

public QueryResultAdapter(RepositoryResult rr)

QueryResultAdapter

public QueryResultAdapter(java.util.List objects)
Method Detail

hasNext

public boolean hasNext()
                throws WavesetException
Description copied from interface: QueryResult
Returns true if there is another row in the result.

Specified by:
hasNext in interface QueryResult
Throws:
WavesetException

next

public QueryResultRow next()
                    throws java.util.NoSuchElementException,
                           WavesetException
Description copied from interface: QueryResult
Returns the next row in the result.

Specified by:
next in interface QueryResult
Throws:
java.util.NoSuchElementException
WavesetException

remove

public void remove()
            throws WavesetException
Description copied from interface: QueryResult
Removes the current row from the result.

Specified by:
remove in interface QueryResult
Throws:
WavesetException

resetIteration

public void resetIteration()
Description copied from interface: QueryResult
Seeks to the first row in the result.

Specified by:
resetIteration in interface QueryResult

getRepositoryResult

public RepositoryResult getRepositoryResult()

toList

public java.util.List toList()
                      throws WavesetException
Description copied from interface: QueryResult
Returns all of the results as a list. If the result contains objects, a list of those objects is returned. If the result contained only selected attribute values, a list of Map objects containing those attributes is returned.

Specified by:
toList in interface QueryResult
Throws:
WavesetException

toList

public java.util.List toList(java.lang.String attname)
                      throws WavesetException
Description copied from interface: QueryResult
Returns all values of one attribute in the result as a list.

Specified by:
toList in interface QueryResult
Throws:
WavesetException

getRowCount

public int getRowCount()
Return the number of rows in the result (or -1 if unknown).


merge

public void merge(QueryResultAdapter s,
                  int limit,
                  java.util.Set dupsMap)
           throws WavesetException
Throws:
WavesetException

merge

public void merge(QueryResultAdapter s,
                  int limit,
                  java.util.Set dupsMap,
                  RepositoryResult.RowMerger rowMerger)
           throws WavesetException
Throws:
WavesetException