com.waveset.object
Class RepositoryResult

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.object.RepositoryResult
All Implemented Interfaces:
javax.naming.Referenceable, XmlObject

public class RepositoryResult
extends AbstractXmlObject

A class used to represent a simple "query result" containing information about a collection of objects.

This object will typically be created by a storage manager to represent the results of a query, but can also be created manually to represent some arbitrary collection of objects.

This started life as an in-memory result set object, though we've extended it to be more of a "cursor-like" result set iterator.

Users should wean themselves away from the getRows() method and start using hasNext(), next(). This may eventually be refactored into an abstract result interface, with a memory implementation and one or more database implementations such one wrapping a java.sql.ResultSet.

There are still issues that need to be addressed before that happens however, notably the lifespan of java.sql.ResultSet and how they transition between machines during load balancing (i.e. they are not serializable, therefore they cannot be attached to an HttpSession). Because of this, we may not be able to support cursors for the web applications, though it may still be desireable to have them for standalone configuration and report generation apps, which are the ones that are more likely to be dealing with large result sets anyway.


Nested Class Summary
static class RepositoryResult.OrderByComparator
          Internal class that implenents the Comparator interface for sorting the rows in the table based on an ordered set of attributes.
static class RepositoryResult.Row
          This class is used to represent each "row" of the result.
static class RepositoryResult.RowComparator
          Implements the Comparator interface for sorting the rows in the table.
static interface RepositoryResult.RowMerger
          Internal class that specifies an interface for merging two rows where the name is the same.
 
Field Summary
protected  boolean _buffered
          If true, this result contains only a subset of rows matching the specified type and attribute conditions.
protected  int _index
          The current iteration position within the result.
protected  RepositoryResult.Row[] _rowArray
          A native array representation of the Row objects stored in the _rows field.
protected  java.util.List _rows
          The list of results.
protected  int _size
          The estimated number of items (rows) matching the caller's query.
protected  boolean _sizeError
          If true, we previously caught an exception getting virtual size.
protected  int _virtualIndex
          Our estimated position within the entire (virtual) result.
static java.lang.String ATT_BLOCK_SIZE
           
static java.lang.String ATT_BUFFERED
           
static java.lang.String ATT_END_BEFORE
           
static java.lang.String ATT_INDEX
           
static java.lang.String ATT_NEED_LOCKINFO
           
static java.lang.String ATT_NEED_OBJECT
           
static java.lang.String ATT_NEED_SUMMARY
           
static java.lang.String ATT_ORDER_BY
           
static java.lang.String ATT_SIZE_ERROR
           
static java.lang.String ATT_START_AFTER
           
static java.lang.String ATT_TARGET_TYPE
           
static java.lang.String ATT_VIRTUAL_INDEX
           
static java.lang.String ATT_VIRTUAL_SIZE
           
static java.lang.String code_id
           
static java.lang.String ELEMENT
           
protected static Trace trace
           
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
RepositoryResult()
          Create an empty result object.
RepositoryResult(org.w3c.dom.Element e)
          Create a result object by parsing a DOM element.
RepositoryResult(java.util.List poList, boolean includeObject, boolean includeAttributes)
          Create a result object containing a collection of objects specified in a List.
RepositoryResult(LockInfo[] lockInfoArray)
          Create a result object containing lock information for a collection of objects.
RepositoryResult(PersistentObject[] poArray)
          Create a result object containing a collection of objects specified in an array.
RepositoryResult(RepositoryResult in)
          Create a result object containing a clone of another repository result
RepositoryResult(java.lang.String xml)
          Create a result object by deserializing its XML representation.
 
Method Summary
 void add(RepositoryResult.Row r)
          Add a new row to the result set.
 void append(RepositoryResult s)
          Append a result set to this one.
 void append(RepositoryResult s, int limit)
           
protected  boolean bufferHasNext()
          Returns true if there are more rows in this result's current buffer.
protected  boolean bufferHasPrevious()
          Returns true if there are previous rows in this result's current buffer.
protected  void clear()
          Remove all of the elements from the row list.
protected  void ensureCapacity(int minCapacity)
          Increase the size of the row list (if necessary) to hold the specified number of elements.
 RepositoryResult.Row first()
           
 RepositoryResult.Row get(int index)
          Deprecated. since GA 1.2. Use next() instead.
 AttributeCondition[] getAttributeConditions()
           
protected  AttributeExpression getAuthorizationFilter()
          Cache an attribute expression that describes the set of items of the target type that the caller is allowed to see.
 int getBlockSize()
           
protected  int getCurrentSize()
          Package-scope method allows RepositoryProxy to count the row list of this Result.
 java.lang.String getDisplayableName(int index)
          Return the display name (if there is one) or the name associated with one of the result rows.
 java.lang.String getDisplayName(int index)
          Return the display name associated with one of the reusult rows.
 java.lang.String getElementName()
          XmlObjectFactory requires this.
protected  java.lang.String[] getEndBefore()
           
protected  boolean getFetchPrevious()
           
 java.lang.String getId(int index)
          Deprecated. since GA 1.2. RepositoryResult now implements Iterator.
 int getIndex()
          Get the current iteration index
 java.lang.String getName(int index)
          Deprecated. since GA 1.2. RepositoryResult now implements Iterator.
 PersistentObject getObject(int index)
          Deprecated. since GA 1.2. RepositoryResult now implements Iterator.
protected  ObjectLoader getObjectLoader()
           
 Attribute[] getOrderBy()
           
 int getRowCount()
          Deprecated. since GA 1.2. RepositoryResult now implements Iterator.
 RepositoryResult.Row[] getRows()
          Deprecated. since GA 1.2. RepositoryResult now implements Iterator.
protected  java.lang.String[] getStartAfter()
           
 boolean getSummaryReferencesResolved()
           
 Type getTargetType()
           
protected  int getVirtualSize()
           
 boolean hasNext()
           
 boolean hasPrevious()
           
 boolean isBuffered()
           
 RepositoryResult.Row last()
           
static void main(java.lang.String[] args)
           
 void merge(RepositoryResult s, int limit, java.util.Set dupsMap)
           
 void merge(RepositoryResult s, int limit, java.util.Set dupsMap, RepositoryResult.RowMerger rowMerger)
           
 RepositoryResult.Row next()
           
 RepositoryResult.Row previous()
           
 void remove(int index)
          Remove a row from the result set.
 void remove(int index, int count)
           
 void remove(RepositoryResult.Row r)
          Remove a row from the result set.
 void resetIteration()
          Seeks to the first row in the result.
protected  void reverse()
          Reverses the order of the elements in the row list.
 void seek(int index)
          Deprecated. - since GA 1.2. Use hasNext() and next().
 void setAttributeConditions(AttributeCondition[] attrConds)
          Cache a set of query attribute conditions supplied by the caller to buffered 'list' and 'get' methods.
protected  void setAuthorizationFilter(AttributeExpression filter)
          Cache an attribute expression that describes the set of items of the target type that the caller is allowed to see.
 void setBlockSize(int blockSize)
          Set the number of items (rows) requested by the caller of buffered 'list' and 'get' methods.
protected  void setBuffered(boolean b)
          Package-level method to set _buffered.
 void setEndBefore(int rowNumber)
          Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.
protected  void setEndBefore(RepositoryResult.Row row)
          Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.
protected  void setEndBefore(java.lang.String[] endBefore)
          Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.
protected  void setFetchPrevious(boolean b)
          Specify whether the result should return rows in descending order.
protected  void setObjectLoader(ObjectLoader objectLoader)
          Set handle to Session (for callback to nextBlock).
protected  void setOrderBy(Attribute[] orderBy)
          Cache a concatenated key specification supplied by the caller to buffered 'list' and 'get' methods.
 void setStartAfter(int rowNumber)
          Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.
protected  void setStartAfter(RepositoryResult.Row row)
          Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.
protected  void setStartAfter(java.lang.String[] startAfter)
          Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.
 void setSummaryReferencesResolved(boolean set)
           
 void setTargetType(Type targetType)
          Cache a concatenated key specification supplied by the caller to buffered 'list' and 'get' methods.
 int size()
           
 int size(boolean forceRead)
           
 void sort()
          Deprecated. since GA 1.2. Instead, call a flavor of 'list' or 'get' that takes an 'orderBy' argument.
 void sort(Attribute[] orderBy)
          Sort based on an ordered set of Attributes.
protected  boolean subclassGetNextBlock()
          Default implementation can be overridden by subclass.
protected  boolean subclassGetPreviousBlock()
          Default implementation can be overridden by subclass.
protected  int subclassGetVirtualSize()
          Default implementation can be overridden by subclass.
 java.lang.String toXml()
          Serialize a result to an XML string.
 void toXml(java.lang.StringBuffer b)
          Original interface, maintained for backward compatibility.
 void toXml(java.lang.StringBuffer b, int indent)
          Serialize a result into an XML buffer.
protected  void trimToSize()
          Trim the capacity of the row list to be the list's current size.
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml
 
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

trace

protected static final Trace trace

ELEMENT

public static final java.lang.String ELEMENT
See Also:
Constant Field Values

_rows

protected java.util.List _rows
The list of results. Each result is represented as an object of class Row


_index

protected int _index
The current iteration position within the result.

It might be nice to support an external Iterator as well so result set iteration could be reentrant.


_virtualIndex

protected int _virtualIndex
Our estimated position within the entire (virtual) result.

Analogous to the field "_index" in RepositoryResult, which represents our position in the current buffer of rows.


_rowArray

protected RepositoryResult.Row[] _rowArray
A native array representation of the Row objects stored in the _rows field. This was originally provided as a convenience, but we should try to move everyone to the iteration interface, and get rid of this.


_size

protected int _size
The estimated number of items (rows) matching the caller's query.

The RepositoryResult pretends to contain all of the rows, but may actually "page" through the result set internally.


_buffered

protected boolean _buffered
If true, this result contains only a subset of rows matching the specified type and attribute conditions.


_sizeError

protected boolean _sizeError
If true, we previously caught an exception getting virtual size.


ATT_TARGET_TYPE

public static final java.lang.String ATT_TARGET_TYPE
See Also:
Constant Field Values

ATT_INDEX

public static final java.lang.String ATT_INDEX
See Also:
Constant Field Values

ATT_ORDER_BY

public static final java.lang.String ATT_ORDER_BY
See Also:
Constant Field Values

ATT_START_AFTER

public static final java.lang.String ATT_START_AFTER
See Also:
Constant Field Values

ATT_END_BEFORE

public static final java.lang.String ATT_END_BEFORE
See Also:
Constant Field Values

ATT_BLOCK_SIZE

public static final java.lang.String ATT_BLOCK_SIZE
See Also:
Constant Field Values

ATT_NEED_OBJECT

public static final java.lang.String ATT_NEED_OBJECT
See Also:
Constant Field Values

ATT_NEED_LOCKINFO

public static final java.lang.String ATT_NEED_LOCKINFO
See Also:
Constant Field Values

ATT_NEED_SUMMARY

public static final java.lang.String ATT_NEED_SUMMARY
See Also:
Constant Field Values

ATT_BUFFERED

public static final java.lang.String ATT_BUFFERED
See Also:
Constant Field Values

ATT_VIRTUAL_INDEX

public static final java.lang.String ATT_VIRTUAL_INDEX
See Also:
Constant Field Values

ATT_VIRTUAL_SIZE

public static final java.lang.String ATT_VIRTUAL_SIZE
See Also:
Constant Field Values

ATT_SIZE_ERROR

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

RepositoryResult

public RepositoryResult()
Create an empty result object.


RepositoryResult

public RepositoryResult(java.lang.String xml)
                 throws WavesetException
Create a result object by deserializing its XML representation.


RepositoryResult

public RepositoryResult(org.w3c.dom.Element e)
                 throws WavesetException
Create a result object by parsing a DOM element.


RepositoryResult

public RepositoryResult(PersistentObject[] poArray)
Create a result object containing a collection of objects specified in an array.

A convenience constructor to convert an array of objects into a result object. This is used mainly by the Repository.


RepositoryResult

public RepositoryResult(java.util.List poList,
                        boolean includeObject,
                        boolean includeAttributes)
Create a result object containing a collection of objects specified in a List.

A convenience constructor to convert a list of objects into a result object.


RepositoryResult

public RepositoryResult(RepositoryResult in)
Create a result object containing a clone of another repository result


RepositoryResult

public RepositoryResult(LockInfo[] lockInfoArray)
Create a result object containing lock information for a collection of objects.

This is used mainly by the Repository.

Method Detail

isBuffered

public boolean isBuffered()
Returns:
false if the result is complete; that is, physically contains all matching rows in memory. Returns true if the result is buffered; that is, contain only a block of rows at any one time.

setBuffered

protected void setBuffered(boolean b)
Package-level method to set _buffered. If Repository knows the result is "complete" (that the current buffer contains all matching rows), then the result should behave (and be treated) as if unbuffered.

See Also:
isBuffered()

getElementName

public java.lang.String getElementName()
XmlObjectFactory requires this.

Specified by:
getElementName in interface XmlObject
Specified by:
getElementName in class AbstractXmlObject

add

public void add(RepositoryResult.Row r)
Add a new row to the result set. The row will be appended.


remove

public void remove(RepositoryResult.Row r)
Remove a row from the result set. Fix the iterator if necessary.


remove

public void remove(int index)
Remove a row from the result set. Fix the iterator if necessary.


remove

public void remove(int index,
                   int count)

append

public void append(RepositoryResult s)
            throws WavesetException
Append a result set to this one.

This was necessary for WavesetConsole which assembles an aggregate result from several repository queries.

NOTE: The rows are not copied, both result sets will end up referencing the same row objects. Normally the source result will become garbage shortly, and this result will take ownership of the rows.

Throws:
WavesetException

append

public void append(RepositoryResult s,
                   int limit)
            throws WavesetException
Throws:
WavesetException

merge

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

merge

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

ensureCapacity

protected void ensureCapacity(int minCapacity)
Increase the size of the row list (if necessary) to hold the specified number of elements.

NOTE: This is intended for use only by Repository.


trimToSize

protected void trimToSize()
Trim the capacity of the row list to be the list's current size.

NOTE: This is intended for use only by Repository.


clear

protected void clear()
Remove all of the elements from the row list.

NOTE: This is intended for use only by Repository.


reverse

protected void reverse()
Reverses the order of the elements in the row list.

NOTE: This is intended for use only by Repository.


getOrderBy

public Attribute[] getOrderBy()
Returns:
- a concatenated key specification supplied by the caller to buffered 'list' and 'get' methods.
See Also:
setOrderBy(com.waveset.object.Attribute[])

setOrderBy

protected void setOrderBy(Attribute[] orderBy)
                   throws InvalidArgument
Cache a concatenated key specification supplied by the caller to buffered 'list' and 'get' methods.

NOTE: This is intended for use only by Repository.

Throws:
InvalidArgument
See Also:
setStartAfter(java.lang.String[])

getAttributeConditions

public AttributeCondition[] getAttributeConditions()

setAttributeConditions

public void setAttributeConditions(AttributeCondition[] attrConds)
                            throws InvalidArgument
Cache a set of query attribute conditions supplied by the caller to buffered 'list' and 'get' methods.

NOTE: This is intended for use only by Repository. GAW - need to expose this so I can set it when merging repo results from the repo and a rule driven user member query.

Throws:
InvalidArgument

getAuthorizationFilter

protected AttributeExpression getAuthorizationFilter()
Cache an attribute expression that describes the set of items of the target type that the caller is allowed to see.

NOTE: This is intended for use only by Session and Repository.


setAuthorizationFilter

protected void setAuthorizationFilter(AttributeExpression filter)
                               throws InvalidArgument
Cache an attribute expression that describes the set of items of the target type that the caller is allowed to see.

NOTE: This is intended for use only by Session and Repository.

Throws:
InvalidArgument

getTargetType

public Type getTargetType()
Returns:
- the type of item this contains.

setTargetType

public void setTargetType(Type targetType)
                   throws InvalidArgument
Cache a concatenated key specification supplied by the caller to buffered 'list' and 'get' methods.

NOTE: This is intended for use only by Repository. GAW - need to expose this so I can set it when merging repo results from the repo and a rule driven user member query.

Throws:
InvalidArgument

getStartAfter

protected java.lang.String[] getStartAfter()
Returns:
- a concatenated key value supplied by the caller of buffered 'list' and 'get' methods. Values correspond one-to-one with Attributes in 'orderBy'.
See Also:
setStartAfter(java.lang.String[]), setOrderBy(com.waveset.object.Attribute[])

setStartAfter

protected void setStartAfter(java.lang.String[] startAfter)
                      throws InvalidArgument
Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.

Throws:
InvalidArgument

setStartAfter

protected void setStartAfter(RepositoryResult.Row row)
                      throws InvalidArgument
Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.

Parameters:
row - - a RepositoryResult.Row. Build a concatenated key from its values.
Throws:
InvalidArgument
See Also:
setOrderBy(com.waveset.object.Attribute[])

setStartAfter

public void setStartAfter(int rowNumber)
                   throws InvalidArgument
Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.

Parameters:
rowNumber - - the index of a row currently stored in this RepositoryResult. Build a concatenated key from its values.
Throws:
InvalidArgument
See Also:
setOrderBy(com.waveset.object.Attribute[])

getEndBefore

protected java.lang.String[] getEndBefore()
Returns:
- a concatenated key value supplied by the caller of buffered 'list' and 'get' methods. Values correspond one-to-one with Attributes in 'orderBy'.
See Also:
setEndBefore(java.lang.String[]), setOrderBy(com.waveset.object.Attribute[])

setEndBefore

protected void setEndBefore(java.lang.String[] endBefore)
                     throws InvalidArgument
Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.

Throws:
InvalidArgument

setEndBefore

protected void setEndBefore(RepositoryResult.Row row)
                     throws InvalidArgument
Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.

Parameters:
row - - a RepositoryResult.Row. Build a concatenated key from its values.
Throws:
InvalidArgument
See Also:
setOrderBy(com.waveset.object.Attribute[])

setEndBefore

public void setEndBefore(int rowNumber)
                  throws InvalidArgument
Set the concatenated key value to select the first row of the next block of items returned by buffered 'list' and 'get' methods.

Parameters:
rowNumber - - the index of a row currently stored in this RepositoryResult. Build a concatenated key from its values.
Throws:
InvalidArgument
See Also:
setOrderBy(com.waveset.object.Attribute[])

getBlockSize

public int getBlockSize()
Returns:
the number of items (rows) requested by the caller of buffered 'list' and 'get' methods.

setBlockSize

public void setBlockSize(int blockSize)
                  throws InvalidArgument
Set the number of items (rows) requested by the caller of buffered 'list' and 'get' methods.

Throws:
InvalidArgument

size

public int size()
Returns:
the estimated number of rows in the entire result set. Returns -1 if the number of rows cannot be estimated.

Service code that needs privileged access to repository result contents may call methods of RepositoryProxy:

See Also:
RepositoryProxy.getCurrentSize(RepositoryResult), RepositoryProxy.getCurrentRowList(RepositoryResult)

size

public int size(boolean forceRead)
Parameters:
forceRead - if true, forces Lighthouse to recalculate the size of the buffered result. If false, this method will rely on any previously cached value.

Service code that needs privileged access to repository result contents may call methods of RepositoryProxy:

Returns:
the estimated number of rows in the entire (virtual) result set. Returns -1 if the number of rows cannot be estimated.

See Also:
RepositoryProxy.getCurrentSize(RepositoryResult), RepositoryProxy.getCurrentRowList(RepositoryResult)

getVirtualSize

protected int getVirtualSize()
Returns:
the estimated number of rows in the entire (virtual) result set. Returns -1 if the number of rows cannot be estimated.

getFetchPrevious

protected boolean getFetchPrevious()
Returns:
true if the result should return rows in descending order; otherwise false. The default is to return rows in ascending order.

NOTE: This is intended for use only by Session and Repository.


setFetchPrevious

protected void setFetchPrevious(boolean b)
                         throws InvalidArgument
Specify whether the result should return rows in descending order. The default is to return rows in ascending order.

NOTE: This is intended for use only by Session and Repository.

Throws:
InvalidArgument

getObjectLoader

protected ObjectLoader getObjectLoader()
Returns:
handle to Session (for callback to nextBlock).

NOTE: This is intended for use only by Repository.


setObjectLoader

protected void setObjectLoader(ObjectLoader objectLoader)
Set handle to Session (for callback to nextBlock).

NOTE: This is intended for use only by Session.


setSummaryReferencesResolved

public void setSummaryReferencesResolved(boolean set)

getSummaryReferencesResolved

public boolean getSummaryReferencesResolved()

bufferHasNext

protected boolean bufferHasNext()
                         throws WavesetException
Returns true if there are more rows in this result's current buffer.

Throws:
WavesetException

bufferHasPrevious

protected boolean bufferHasPrevious()
                             throws WavesetException
Returns true if there are previous rows in this result's current buffer.

Throws:
WavesetException

hasNext

public boolean hasNext()
                throws WavesetException
Returns:
true if there are more rows in the result. Use next() (or one of the "get" methods) to obtain information for the current row.
Throws:
WavesetException

hasPrevious

public boolean hasPrevious()
                    throws WavesetException
Returns:
true if there are previous rows in the result. Use previous() to get the row prior to the current row.
Throws:
WavesetException

next

public RepositoryResult.Row next()
                          throws java.util.NoSuchElementException,
                                 WavesetException
Returns:
the next row in the result (and advance the iteration index). // *

// * We could implement the java.util.Iterator interface, // * but then we'd have to return Object and downcast. // * We would also be constrained on the sorts of exceptions we can // * throw, and its likely that we're going to want a number of them. // *

// * Could also support more of a JDBC like interface where // * next() doesn't return anything, and then we'd need a bunch // * of accessors for "columns" in the current row.

Throws:
java.util.NoSuchElementException
WavesetException

previous

public RepositoryResult.Row previous()
                              throws java.util.NoSuchElementException,
                                     WavesetException
Returns:
the previous row in the result (and retard the iteration index). // *

// * We could implement the java.util.Iterator interface, // * but then we'd have to return Object and downcast. // * We would also be constrained on the sorts of exceptions we can // * throw, and its likely that we're going to want a number of them. // *

// * Could also support more of a JDBC like interface where // * next() doesn't return anything, and then we'd need a bunch // * of accessors for "columns" in the current row.

Throws:
java.util.NoSuchElementException
WavesetException

first

public RepositoryResult.Row first()
                           throws java.util.NoSuchElementException,
                                  WavesetException
Returns:
the first row in the result.
Throws:
java.util.NoSuchElementException
WavesetException

last

public RepositoryResult.Row last()
                          throws java.util.NoSuchElementException,
                                 WavesetException
Returns:
the last row in the result.
Throws:
java.util.NoSuchElementException
WavesetException

subclassGetNextBlock

protected boolean subclassGetNextBlock()
                                throws WavesetException
Default implementation can be overridden by subclass.

Throws:
WavesetException

subclassGetPreviousBlock

protected boolean subclassGetPreviousBlock()
                                    throws WavesetException
Default implementation can be overridden by subclass.

Throws:
WavesetException

subclassGetVirtualSize

protected int subclassGetVirtualSize()
                              throws WavesetException
Default implementation can be overridden by subclass.

Throws:
WavesetException

seek

public void seek(int index)
          throws java.util.NoSuchElementException
Deprecated. - since GA 1.2. Use hasNext() and next().

Seeks to a particular row in the result.

Throws:
java.util.NoSuchElementException

resetIteration

public void resetIteration()
Seeks to the first row in the result.

See Also:
first()

getIndex

public int getIndex()
Get the current iteration index


sort

public void sort()
          throws InternalError
Deprecated. since GA 1.2. Instead, call a flavor of 'list' or 'get' that takes an 'orderBy' argument.

Sort. Default implementation is by name.

Throws:
InternalError

sort

public void sort(Attribute[] orderBy)
          throws InvalidArgument
Sort based on an ordered set of Attributes.

Throws:
InvalidArgument

getRows

public RepositoryResult.Row[] getRows()
Deprecated. since GA 1.2. RepositoryResult now implements Iterator.

Return the entire result set as an array of Row objects. This should not be used by new code, use the iteration interfaces instead.


getCurrentSize

protected int getCurrentSize()
Package-scope method allows RepositoryProxy to count the row list of this Result.


getRowCount

public int getRowCount()
Deprecated. since GA 1.2. RepositoryResult now implements Iterator.

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


get

public RepositoryResult.Row get(int index)
Deprecated. since GA 1.2. Use next() instead.

Return the row at the given index.


getObject

public PersistentObject getObject(int index)
Deprecated. since GA 1.2. RepositoryResult now implements Iterator.

Return the object associated with one of the reusult rows. A convenience method for iterating over object results.


getName

public java.lang.String getName(int index)
Deprecated. since GA 1.2. RepositoryResult now implements Iterator.

Return the name associated with one of the reusult rows. A convenience method for iterating over query results.


getDisplayName

public java.lang.String getDisplayName(int index)
Return the display name associated with one of the reusult rows.


getDisplayableName

public java.lang.String getDisplayableName(int index)
Return the display name (if there is one) or the name associated with one of the result rows.


getId

public java.lang.String getId(int index)
Deprecated. since GA 1.2. RepositoryResult now implements Iterator.

Return the ID associated with one of the result rows. A convenience method for iterating over query results.


toXml

public java.lang.String toXml()
Serialize a result to an XML string. Note that this overrides the AbstractXmlObject method that includes an XML header and DOCTYPE, not sure if that is significant - jsl

Specified by:
toXml in interface XmlObject
Overrides:
toXml in class AbstractXmlObject

toXml

public void toXml(java.lang.StringBuffer b)
Original interface, maintained for backward compatibility. XmlObject requires toXml(StringBuffer, int)

Overrides:
toXml in class AbstractXmlObject

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Serialize a result into an XML buffer. Serialize the fields associated with our "stateless cursor": targetType, attrConds, orderBy, startAfter, blockSize, ....

Specified by:
toXml in interface XmlObject
Specified by:
toXml in class AbstractXmlObject

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception