arlut.csd.ganymede
Class QueryResult

java.lang.Object
  |
  +--arlut.csd.ganymede.QueryResult
All Implemented Interfaces:
java.io.Serializable

public class QueryResult
extends java.lang.Object
implements java.io.Serializable

This class is a serializable object-list result object, which conveys results from a query/list operation along with methods that can be used to extract the results out of the query/list.

See Also:
Serialized Form

Field Summary
(package private)  java.lang.StringBuffer buffer
           
static arlut.csd.Util.Compare comparator
           
(package private) static boolean debug
           
private  boolean forTransport
           
(package private)  java.util.Vector handles
           
(package private)  arlut.csd.Util.VecSortInsert inserter
           
(package private)  java.util.Hashtable invidHash
           
(package private)  java.util.Vector invidList
           
(package private)  java.util.Hashtable labelHash
           
(package private)  java.util.Vector labelList
           
(package private) static long serialVersionUID
           
private  boolean unpacked
           
 
Constructor Summary
QueryResult()
           
QueryResult(boolean forTransport)
          Constructor.
 
Method Summary
 void addRow(arlut.csd.ganymede.Invid invid, java.lang.String label, boolean editable)
          This method is used to add an object's information to the QueryResult's serializable buffer.
 void addRow(arlut.csd.ganymede.Invid invid, java.lang.String label, boolean inactive, boolean expirationSet, boolean removalSet, boolean editable)
          This method is used to add an object's information to the QueryResult's serializable buffer.
 void addRow(arlut.csd.ganymede.ObjectHandle handle)
          This method is used to add an object's information to the QueryResult's serializable buffer.
 void append(arlut.csd.ganymede.QueryResult result)
          This is a pre-serialization method for concatenating another (for transport) QueryResult to ourself.
 boolean containsInvid(arlut.csd.ganymede.Invid invid)
          This method is provided for the server to optimize it's QueryResult loading operations, and is not intended for use post-serialization.
 boolean containsLabel(java.lang.String label)
          This method is provided for the server to optimize it's QueryResult loading operations, and is not intended for use post-serialization.
 java.lang.String getBuffer()
          For debug.
 java.util.Vector getHandles()
          This method is used by arlut.csd.ganymede.client.objectList to get access to the raw and sorted vector of ObjectHandle's post-serialization.

Note that this method does not clone our handles vector, we'll just assume that whatever the objectList class on the client does to this vector, we're not going to disturb anyone else who will be looking at the handle list on this query result object.
 arlut.csd.ganymede.Invid getInvid(int row)
           
 java.util.Vector getInvids()
           
 java.lang.String getLabel(int row)
           
 java.util.Vector getLabels()
           
 arlut.csd.JDataComponent.listHandle getListHandle(int row)
          Returns the listHandle for this row.
 java.util.Vector getListHandles()
          Returns a complete listHandle Vector representation of the results included in this QueryResult.
 java.util.Vector getListHandles(boolean includeInactives, boolean includeNonEditables)
          Returns a (possibly filtered) listHandle Vector representation of the results included in this QueryResult.
 arlut.csd.ganymede.ObjectHandle getObjectHandle(int row)
          Returns the ObjectHandle for this row.
 arlut.csd.ganymede.QueryResult intersection(arlut.csd.ganymede.QueryResult operand)
          This method returns a QueryResult which holds the intersection of the contents of this QueryResult and the contents of operand.
 boolean isForTransport()
           
 int size()
           
private  void unpackBuffer()
          Private method to handle building up our datastructure on the post-serialization side.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

debug

static final boolean debug
See Also:
Constant Field Values

comparator

public static arlut.csd.Util.Compare comparator

invidHash

transient java.util.Hashtable invidHash

labelHash

transient java.util.Hashtable labelHash

forTransport

private boolean forTransport

buffer

java.lang.StringBuffer buffer

unpacked

private transient boolean unpacked

handles

transient java.util.Vector handles

labelList

transient java.util.Vector labelList

invidList

transient java.util.Vector invidList

inserter

transient arlut.csd.Util.VecSortInsert inserter
Constructor Detail

QueryResult

public QueryResult()

QueryResult

public QueryResult(boolean forTransport)
Constructor.

Parameters:
forTransport - If true, this QueryResult will prepare information fed into it for transport by maintaining a StringBuffer.
Method Detail

addRow

public void addRow(arlut.csd.ganymede.Invid invid,
                   java.lang.String label,
                   boolean editable)
This method is used to add an object's information to the QueryResult's serializable buffer. It is intended to be called on the server, but may also be called on the client for result augmentation.


addRow

public void addRow(arlut.csd.ganymede.ObjectHandle handle)
This method is used to add an object's information to the QueryResult's serializable buffer. It is intended to be called on the server, but may also be called on the client for result augmentation.


addRow

public void addRow(arlut.csd.ganymede.Invid invid,
                   java.lang.String label,
                   boolean inactive,
                   boolean expirationSet,
                   boolean removalSet,
                   boolean editable)
This method is used to add an object's information to the QueryResult's serializable buffer. It is intended to be called on the server, but may also be called on the client for result augmentation.


getHandles

public java.util.Vector getHandles()
This method is used by arlut.csd.ganymede.client.objectList to get access to the raw and sorted vector of ObjectHandle's post-serialization.

Note that this method does not clone our handles vector, we'll just assume that whatever the objectList class on the client does to this vector, we're not going to disturb anyone else who will be looking at the handle list on this query result object.


getInvid

public arlut.csd.ganymede.Invid getInvid(int row)

getInvids

public java.util.Vector getInvids()

getLabels

public java.util.Vector getLabels()

getLabel

public java.lang.String getLabel(int row)

isForTransport

public boolean isForTransport()

size

public int size()

getListHandles

public java.util.Vector getListHandles()
Returns a complete listHandle Vector representation of the results included in this QueryResult.


getListHandles

public java.util.Vector getListHandles(boolean includeInactives,
                                       boolean includeNonEditables)
Returns a (possibly filtered) listHandle Vector representation of the results included in this QueryResult.

Parameters:
includeInactives - if false, inactive objects' handles won't be included in the returned vector
includeNonEditables - if false, non-editable objects' handles won't be included in the returned vector

getListHandle

public arlut.csd.JDataComponent.listHandle getListHandle(int row)
Returns the listHandle for this row.


getObjectHandle

public arlut.csd.ganymede.ObjectHandle getObjectHandle(int row)
Returns the ObjectHandle for this row.


containsInvid

public boolean containsInvid(arlut.csd.ganymede.Invid invid)
This method is provided for the server to optimize it's QueryResult loading operations, and is not intended for use post-serialization.


containsLabel

public boolean containsLabel(java.lang.String label)
This method is provided for the server to optimize it's QueryResult loading operations, and is not intended for use post-serialization.


append

public void append(arlut.csd.ganymede.QueryResult result)
This is a pre-serialization method for concatenating another (for transport) QueryResult to ourself.


intersection

public arlut.csd.ganymede.QueryResult intersection(arlut.csd.ganymede.QueryResult operand)
This method returns a QueryResult which holds the intersection of the contents of this QueryResult and the contents of operand.


unpackBuffer

private void unpackBuffer()
Private method to handle building up our datastructure on the post-serialization side. Sorts the handles vector as it is extracted.


getBuffer

public java.lang.String getBuffer()
For debug.