Package COM.TIBCO.hawk.talon
Class TabularData
java.lang.Object
COM.TIBCO.hawk.talon.TabularData
- All Implemented Interfaces:
Serializable
An open data type used to tabular data structures.
TabularData object may have a variable number of rows (including none) and still conform to the TabularDataDescriptor
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTabularData(String[] columnNames, String[] indexNames, 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. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsRow(DataElement[] indexes) Returns true if the table contains the row indexed by the specified data elements.booleanCompares this object against the specified object.Object[][]Retrieves all elements of the table in an array of Object arrays.DataElement[][]Retrieves all elements of the table in an array of DataElement arrays.String[]Returns an array of the column names used to construct this tableString[]An array of strings representing the types of the data objects in each column.String[]Returns an array of the index names used to construct this tablegetRow(DataElement[] indexes) Retrieves the row, uniquely indexed by theindexesparameter, as an array of Object.toString()toXML()
-
Constructor Details
-
TabularData
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.- Parameters:
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 thecolumnNamesparameter.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 thecolumnNamesarray 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 theindexNamesparameter.
-
-
Method Details
-
toString
-
toXML
-
equals
Compares this object against the specified object.Two TabularData objects are considered equal if
- they have the same column names (although they may not have been specified in same order)
- they have the same index names (although they may not have been specified in same order)
- they have the same number of rows (although they may not have been specified in same order)
- each uniquely indexed row of one has the same column values as the same uniquely indexed row of the other
-
containsRow
Returns true if the table contains the row indexed by the specified data elements.- Parameters:
indexes- Array of DataElements forming a unique index into the table.
-
getRow
Retrieves the row, uniquely indexed by theindexesparameter, 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.- Parameters:
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 bygetIndexNames(). 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.- Returns:
- an array of DataElement objects representing the row, or null if row not found.
- Throws:
IllegalArgumentException- if parameter conditions are violated.- See Also:
-
getAllDataElements
Retrieves all elements of the table in an array of DataElement arrays.- Returns:
- null if table is empty
-
getAllData
Retrieves all elements of the table in an array of Object arrays.- Returns:
- null if table is empty
-
getIndexNames
Returns an array of the index names used to construct this table -
getColumnNames
Returns an array of the column names used to construct this table -
getColumnTypes
An array of strings representing the types of the data objects in each column. The type names in this array correspond to the the columns identified in the array returned bygetColumnNames()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.
-