public class TabularData
extends java.lang.Object
implements java.io.Serializable
TabularData object may have a variable number of rows (including none) and still conform to the TabularDataDescriptor
Constructor and Description |
---|
TabularData(java.lang.String[] columnNames,
java.lang.String[] indexNames,
java.lang.Object[][] data)
Constructor
NOTE: when building a TabularData object to conform to a particular
TabularDataDescriptor, it may have 0 rows but the columnNames
parameter must still match those specified by the descriptor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsRow(DataElement[] indexes)
Returns true if the table contains the row indexed by the specified
data elements.
|
boolean |
equals(java.lang.Object obj)
Compares this object against the specified object.
|
java.lang.Object[][] |
getAllData()
Retrieves all elements of the table in an array of Object arrays.
|
DataElement[][] |
getAllDataElements()
Retrieves all elements of the table in an array of DataElement arrays.
|
java.lang.String[] |
getColumnNames()
Returns an array of the column names used to construct this table
|
java.lang.String[] |
getColumnTypes()
An array of strings representing the types of the data objects
in each column.
|
java.lang.String[] |
getIndexNames()
Returns an array of the index names used to construct this table
|
DataElement[] |
getRow(DataElement[] indexes)
Retrieves the row, uniquely indexed by the
indexes parameter,
as an array of Object. |
java.lang.String |
toString() |
java.lang.String |
toXML() |
public TabularData(java.lang.String[] columnNames, java.lang.String[] indexNames, java.lang.Object[][] data)
columnNames
- Identifies the names of all columns. Must contain at least one
column name. All column names must
be non-null and non-empty strings. No two columns may
have the same name.indexNames
- Identifies those columns of the table that
can be used as a unique index for each row.
Must identify at least one index column.
All index names must be non-null and non-empty strings.
No two array entries may contain the same string.
All index names identified by this array must also be present
in the array specified by the columnNames
parameter.data
- An array of arrays containing objects representing each cell of the table
to be constructed.
Every object must be of a type which is one of the open data types
as identified by the OpenData interface.
Their ordering corresponds directly to their position in the table.
Every row must have the same number columns as the length of the
columnNames
array parameter.
Ex: data[x][y] identifies the cell in row x, column y where column y
is labeled by columnNames[y].
If data has 0 rows or is null, an empty table is constructed.
The values of every cell in a single column must be of the same type or null.
Each row must be uniquely indexed. That is,
each row must have a unique combination of cell values
for those cells in the columns identified by the indexNames
parameter.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toXML()
public boolean equals(java.lang.Object obj)
Two TabularData objects are considered equal if
equals
in class java.lang.Object
public boolean containsRow(DataElement[] indexes)
indexes
- Array of DataElements forming a unique index into the table.public DataElement[] getRow(DataElement[] indexes)
indexes
parameter,
as an array of Object. The returned row is represented by an array of DataElememnt objects,
each one corresponding to a cell of the row. DataElement.getName() identifies the
column of the cell and DataElement.getValue() returns the value of that cell.indexes
- A DataElement array holding the objects used to uniquely identify a row.
The DataElement names must all be strings which must be equal, in number and in value,
to those returned by getIndexNames()
. They identify columns in the table.
The corresponding DataElement values represent table cell values (in
the corresponding columns) which will be used to retrieve the row.
This parameter may not be null.java.lang.IllegalArgumentException
- if parameter conditions are violated.public DataElement[][] getAllDataElements()
public java.lang.Object[][] getAllData()
public java.lang.String[] getIndexNames()
public java.lang.String[] getColumnNames()
public java.lang.String[] getColumnTypes()
getColumnNames()
at the same array index.
A null element in this array indicates that that column contained only null values and thus the intended type, assuming it wasn't null, could not be determined. A value such as "java.lang.String" indicates that that column contains values that are either of type "java.lang.String" or null.
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.