public class QueryResultContainer
extends java.lang.Object
implements java.util.List, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
ARRAYROWS |
(package private) java.util.List |
handles
An ordered list of ObjectHandles that correspond to the DBObject
represented in each row of the result set.
|
(package private) java.util.List |
headers
An ordered list of headers that correspond to each column in this result
set.
|
(package private) java.util.Map |
invidHash
Optimization structure that speeds up obtaining an object's label given that
DBObject's invid.
|
(package private) java.util.Vector |
invidList
Optimization structure that speeds up obtaining a list of invids for each
object referenced in the result set.
|
(package private) java.util.Map |
labelHash
Optimization structure that speeds up obtaining an Invid given a DBObject's
label.
|
(package private) java.util.Vector |
labelList
Optimization structure that speeds up obtaining a list of labels for each
object referenced in the result set.
|
static int |
MAPROWS |
(package private) java.util.List |
rows
A list of Object[].
|
(package private) int |
rowType |
(package private) static long |
serialVersionUID |
(package private) java.util.List |
types
An ordered list of Shorts that correspond to the DBField ID's of each
column in this result set.
|
| Constructor and Description |
|---|
QueryResultContainer() |
QueryResultContainer(int rowType)
The rowType specifies what composition the result set has.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
java.lang.Object element) |
boolean |
add(java.lang.Object o) |
boolean |
addAll(java.util.Collection c) |
boolean |
addAll(int index,
java.util.Collection c) |
void |
addField(java.lang.String fieldName,
java.lang.Short fieldID)
Adds a field header to this query result.
|
void |
addRow(Invid invid,
java.lang.String label,
java.lang.Object[] row,
boolean editable)
This method is used to add an object's information to
the QueryResult's set of objects that matched the original
query.
|
void |
addRow(Invid invid,
java.lang.String label,
java.lang.Object[] row,
boolean inactive,
boolean expirationSet,
boolean removalSet,
boolean editable)
This method is used to add an object's information to
the QueryResult's set of objects that matched the original
query.
|
void |
addRow(ObjectHandle handle,
java.lang.Object[] row)
This method is used to add an object's information to
the QueryResult's set of objects that matched the original
query.
|
void |
changeRowType(int newRowType)
Changes this result set from using rows of one type to rows of another.
|
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection c) |
boolean |
containsInvid(Invid invid)
Returns boolean showing if the result set contains the given Invid.
|
boolean |
containsLabel(java.lang.String label)
Returns boolean showing if the result set contains an object with the
given label.
|
private java.util.Map |
convertArrayRowToMapRow(java.lang.Object[] row)
Takes a row as represented in a result set with row type ARRAYROWS and
converts it to one that matches the row type MAPROWS.
|
private java.lang.Object[] |
convertMapRowToArrayRow(java.util.Map row)
Takes a row as represented in a result set with row type MAPROWS and
converts it to one that matches the row type ARRAYROWS.
|
java.lang.Object |
get(int index) |
java.util.Vector |
getFieldRow(int rowNumber)
This method can be called on the client to obtain a
Vector containing the data values returned for
the object at row row, in field order matching the field
names and types returned by getHeaders() and
getTypes(). |
java.util.List |
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.
|
java.util.List |
getHeaders()
This method can be called on the client to obtain a
Vector of field names, used to generate the
list of column headers in the GUI client. |
Invid |
getInvid(int row)
Grab the Invid of the object represented in the given row of the
result set.
|
java.util.Vector |
getInvids()
Grab the list of Invids that are contained in this result set.
|
java.lang.String |
getLabel(int row)
Grabs the label for the object represented in the given row of the result
set.
|
java.util.Vector |
getLabels()
Grab a list of the labels of each object contained in this result set.
|
ObjectHandle |
getObjectHandle(int row)
Returns the ObjectHandle for this row.
|
java.lang.Object |
getResult(int row,
int col)
This method can be called on the client to obtain an Object
encoding the result value for the colth field in the
rowth object.
|
java.util.List |
getRows()
This method can be called on the client to obtain a
List of Vectors, each of which contains
the data values returned for each object, in field order matching
the field names and types returned by getHeaders()
and getHeaderObjects(). |
java.util.List |
getTypes()
This method can be called on the client to obtain a
Vector of field type Shorts (enumerated in the FieldType static constants),
identifying the types of fields for each column in the
DumpResult. |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
java.util.Iterator |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator |
listIterator() |
java.util.ListIterator |
listIterator(int index) |
private void |
rebuildTransients()
Used to rebuild any ancillary data-structures that aren't preserved during
serialization/deserialization.
|
java.lang.Object |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection c) |
int |
resultSize()
This method can be called on the client to determine the
number of objects encoded in this result set.
|
boolean |
retainAll(java.util.Collection c) |
java.lang.Object |
set(int index,
java.lang.Object element) |
int |
size() |
java.util.List |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
java.lang.String |
toString() |
static final long serialVersionUID
java.util.List headers
java.util.List types
java.util.List rows
java.util.List handles
transient java.util.Vector labelList
transient java.util.Vector invidList
transient java.util.Map labelHash
transient java.util.Map invidHash
public static final int ARRAYROWS
public static final int MAPROWS
int rowType
public QueryResultContainer()
public QueryResultContainer(int rowType)
rowType - Either QueryResultContainer.ARRAYROWS or QueryResultContainer.MAPROWSpublic void addField(java.lang.String fieldName,
java.lang.Short fieldID)
public void addRow(Invid invid, java.lang.String label, java.lang.Object[] row, boolean editable)
public void addRow(ObjectHandle handle, java.lang.Object[] row)
public void addRow(Invid invid, java.lang.String label, java.lang.Object[] row, boolean inactive, boolean expirationSet, boolean removalSet, boolean editable)
public java.util.List getHandles()
public Invid getInvid(int row)
row - public java.util.Vector getInvids()
public java.util.Vector getLabels()
public java.lang.String getLabel(int row)
row - public ObjectHandle getObjectHandle(int row)
public boolean containsInvid(Invid invid)
public boolean containsLabel(java.lang.String label)
public java.util.List getHeaders()
This method can be called on the client to obtain a Vector of field names, used to generate the
list of column headers in the GUI client.
public java.util.List getTypes()
This method can be called on the client to obtain a Vector of field type Shorts (enumerated in the FieldType static constants),
identifying the types of fields for each column in the
DumpResult.
public java.util.List getRows()
This method can be called on the client to obtain a List of Vectors, each of which contains
the data values returned for each object, in field order matching
the field names and types returned by getHeaders()
and getHeaderObjects().
public java.util.Vector getFieldRow(int rowNumber)
This method can be called on the client to obtain a Vector containing the data values returned for
the object at row row, in field order matching the field
names and types returned by getHeaders() and
getTypes().
public java.lang.Object getResult(int row,
int col)
This method can be called on the client to obtain an Object encoding the result value for the colth field in the rowth object.
These Objects may be aDouble
for Float fields, an Integer for Numeric fields,
a Date for Date fields, or a String for other
fields.public int resultSize()
This method can be called on the client to determine the number of objects encoded in this result set.
private void rebuildTransients()
private java.util.Map convertArrayRowToMapRow(java.lang.Object[] row)
row - private java.lang.Object[] convertMapRowToArrayRow(java.util.Map row)
row - public void changeRowType(int newRowType)
newRowType - This should be either MAPROWS or ARRAYROWS, which are
both constants defined in this class.public void add(int index,
java.lang.Object element)
add in interface java.util.Listpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.Listpublic boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.Listpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Listpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Listpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Listpublic java.lang.Object get(int index)
get in interface java.util.Listpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.Listpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.Listpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listpublic int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.Listpublic java.util.ListIterator listIterator()
listIterator in interface java.util.Listpublic java.util.ListIterator listIterator(int index)
listIterator in interface java.util.Listpublic java.lang.Object remove(int index)
remove in interface java.util.Listpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Listpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Listpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.Listpublic java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.Listpublic int size()
size in interface java.util.Collectionsize in interface java.util.Listpublic java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.Listpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.Listpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.Listpublic java.lang.String toString()
toString in class java.lang.Object