com.plumtree.server
Interface IPTQueryResult

All Superinterfaces:
IPTUnknown

public interface IPTQueryResult
extends IPTUnknown

IPTQueryResult are returned by many server calls. They contain 2D arrays of "raw" data, as well as descriptive metadata (such as sorting information, the properties that are included in the results, etc.) The data is arranged into rows and columns. Each row corresponds to a data set, and each column corresponds to a property about the data set (a property as defined in PT_PROPIDS.) For example, when use the User Object Manager to request a list of User objects in an Administrative Folder, the resulting IPTQueryResult will have a row for each User, and columns for properties like PT_PROPID_OBJECTID and PT_PROPID_NAME When requesting data from a IPTQueryResult, the client typically knows the property that's desired , but does not necessarily know what column stores that data. The IPTQueryResult interface abstracts away the need to know which column contains what data- when requesting a cell from the IPTQueryResult, the client only has to specify row and property ID.

Author:
michaels
See Also:
PT_PROPIDS

Method Summary
 int[] Columns()
          Returns an array which contains the PT_PROPIDS constant describing the contents of each column.
 boolean ContainsPropID(int nPropID)
          Returns a boolean indicating if the specified property (from PT_PROPIDS) is in this IPTQueryResult.
 java.lang.Object[][] Data()
          Returns the raw data underlying this QueryResult.
 int IsOrdered()
          The Plumtree Server will attempt to order result sets before returning them through IPTQueryResult.
 double ItemAsDouble(int nRow, int nPropID)
          Returns the value of a "cell" in this IPTQueryResult.
 float ItemAsFloat(int nRow, int nPropID)
          Returns the value of a "cell" in this IPTQueryResult.
 int ItemAsInt(int nRow, int nPropID)
          Returns the value of a "cell" in this IPTQueryResult.
 java.lang.Object ItemAsObject(int nRow, int nPropID)
          Returns the value of a "cell" in this IPTQueryResult.
 java.lang.String ItemAsString(int nRow, int nPropID)
          Returns the value of a "cell" in this IPTQueryResult.
 com.plumtree.openfoundation.util.XPDateTime ItemAsXPDateTime(int nRow, int nPropID)
          Returns the value of a "cell" in this IPTQueryResult.
 int[][] OrderedBy()
          Calls that return IPTQueryResults generally order the data before returning it.
 int RowCount()
          Returns the number of rows in this IPTQueryResult
 
Methods inherited from interface com.plumtree.server.IPTUnknown
GetInterfaces
 

Method Detail

Columns

int[] Columns()
Returns an array which contains the PT_PROPIDS constant describing the contents of each column. For example, if a call to IPTQueryResult.Data returned an array with two columns containing Object ID and Name, then a call to Columns would return an array with two elements: PT_PROPID_OBJECTID and PT_PROPID_NAME.

Returns:
The array of PT_PROPIDS values corresponding to the internal columns
See Also:
PT_PROPIDS

Data

java.lang.Object[][] Data()
Returns the raw data underlying this QueryResult. The columns in this result are described by the results of the Columns call.

Returns:
a 2D array containing the data that underlies this IPTQueryResult

IsOrdered

int IsOrdered()
The Plumtree Server will attempt to order result sets before returning them through IPTQueryResult. There may be times when this ordering is too expensive to perform, in which case the results are not perfectly ordered. The client may choose to order the results, or display "as-is." Call IsOrdered to find out of the Server was able to order the result set.

Returns:
zero for not ordered, nonzero for ordered

OrderedBy

int[][] OrderedBy()
Calls that return IPTQueryResults generally order the data before returning it. Use the OrderedBy call to find out what the order of the data is. Note that when IsOrdered returns FALSE, OrderedBy will return information about the intended ordering of the results, even when that ordering wasn't achieved. The return value is a 2D array describing the ordering of this IPTQueryResult. Each row indicates an order. The first column indicates the PT_PROPIDS property by which the result is ordered, and the second column indicates the sort direction (from PT_ORDERBY_SETTINGS.) For example, if a dataset were ordered by name ascending, then objectid descending, the return value for OrderedBy would look like: PT_PROPID_NAME PT_ORDERBY_ASCENDING PT_PROPID_OBJECTID PT_ORDERBY_DESCENDING

Returns:
a 2D array describing the ordering of this IPTQueryResult.
See Also:
PT_PROPIDS, PT_ORDERBY_SETTINGS

RowCount

int RowCount()
Returns the number of rows in this IPTQueryResult

Returns:
the number of rows in this IPTQueryResult

ItemAsInt

int ItemAsInt(int nRow,
              int nPropID)
Returns the value of a "cell" in this IPTQueryResult.

Parameters:
nRow - the row number (a zero based index)
nPropID - the property ID of the desired property (from PT_PROPIDS)
Returns:
the cell value, as an int

ItemAsString

java.lang.String ItemAsString(int nRow,
                              int nPropID)
Returns the value of a "cell" in this IPTQueryResult.

Parameters:
nRow - the row number (a zero based index)
nPropID - the property ID of the desired property (from PT_PROPIDS)
Returns:
the cell value, as a string

ItemAsXPDateTime

com.plumtree.openfoundation.util.XPDateTime ItemAsXPDateTime(int nRow,
                                                             int nPropID)
Returns the value of a "cell" in this IPTQueryResult.

Parameters:
nRow - the row number (a zero based index)
nPropID - the property ID of the desired property (from PT_PROPIDS)
Returns:
the cell value, as an XPDateTime

ItemAsFloat

float ItemAsFloat(int nRow,
                  int nPropID)
Returns the value of a "cell" in this IPTQueryResult.

Parameters:
nRow - the row number (a zero based index)
nPropID - the property ID of the desired property (from PT_PROPIDS)
Returns:
the cell value, as a float

ItemAsDouble

double ItemAsDouble(int nRow,
                    int nPropID)
Returns the value of a "cell" in this IPTQueryResult.

Parameters:
nRow - the row number (a zero based index)
nPropID - the property ID of the desired property (from PT_PROPIDS)
Returns:
the cell value, as a double

ItemAsObject

java.lang.Object ItemAsObject(int nRow,
                              int nPropID)
Returns the value of a "cell" in this IPTQueryResult.

Parameters:
nRow - the row number (a zero based index)
nPropID - the property ID of the desired property (from PT_PROPIDS)
Returns:
the cell value, as an Object

ContainsPropID

boolean ContainsPropID(int nPropID)
Returns a boolean indicating if the specified property (from PT_PROPIDS) is in this IPTQueryResult. Calling this function is equivalent to calling Columns, and searching for the indicated property.

Parameters:
nPropID - the property desired, from PT_PROPIDS
Returns:
a boolean indicating if the specified property is in this IPTQueryResult


Copyright 2008 Plumtree Software Inc. All Rights Reserved.