commonj.connector.metadata.discovery.properties
Interface TableProperty

All Superinterfaces:
Cloneable, Property, PropertyDescriptor

public interface TableProperty
extends Property, Cloneable

A property representing a table of information with rows and columns. Each column is defined by a PropertyDescriptor instance with a name and a type. Each table cell holds a single value.

Since:
1.0

Nested Class Summary
static interface TableProperty.ColumnDescriptor
          The descriptor interface for a column.
 
Method Summary
 SingleValuedProperty[] createNewRow()
          Creates a new row at the end of the table.
 SingleValuedProperty[] createNewRow(int index)
          Inserts a new row at the given row index.
 void deleteRow(int index)
          Deletes the row with the given index.
 SingleValuedProperty getCellProperty(int row, int column)
          Returns all the property descriptors, that represent the complete contents of the table.
 TableProperty.ColumnDescriptor[] getColumns()
          Returns the array of column descriptors that describe the types of each column.
 SingleValuedProperty[] getRowProperties(int index)
          Returns the array of values at a particular row index.
 int rowCount()
          Returns the current total number of rows in the table.
 
Methods inherited from interface commonj.connector.metadata.discovery.properties.Property
getValidationMessage, isSet, isValid, unSet
 
Methods inherited from interface commonj.connector.metadata.discovery.properties.PropertyDescriptor
addPropertyChangeListener, clone, getDescription, getDisplayName, getID, getName, isEnabled, removePropertyChangeListener
 

Method Detail

getColumns

TableProperty.ColumnDescriptor[] getColumns()
Returns the array of column descriptors that describe the types of each column.

Returns:
a non null array of column descriptors that describe the types of each column in the table. A table should never have zero columns.

getRowProperties

SingleValuedProperty[] getRowProperties(int index)
Returns the array of values at a particular row index. The values contained in the returned array reflect the values of each column in the row

Parameters:
index - the desired row index. The index must be within the valid index range: 0 <= index < rowCount().
Returns:
a non null SingleValuedProperty whose SingleTypedProperty.getPropertyType()is identical to the type represented by the column. The SingleValuedProperty.getValue()returns the current value of the cell.

getCellProperty

SingleValuedProperty getCellProperty(int row,
                                     int column)
Returns all the property descriptors, that represent the complete contents of the table.

Parameters:
row - the desired row index. The index must be within the valid index range: 0 <= row < rowCount().
column - the desired column index. The index must be within the valid index range: 0 <= column < getColumns()length.
Returns:
a non null SingleValuedProperty whose SingleTypedProperty.getPropertyType()is identical to the type represented by the column. The SingleValuedProperty.getValue()returns the current value of the cell.

deleteRow

void deleteRow(int index)
Deletes the row with the given index.

Parameters:
index - the desired row index. The index must be within the valid index range: 0 <= index < rowCount().

createNewRow

SingleValuedProperty[] createNewRow()
                                    throws MetadataException
Creates a new row at the end of the table. The values for this new row may be set by obtaining SingleValuedProperty instances for each cell in the row via calls to getCellProperty(int, int)or getRowProperties(int).

Returns:
a non null SingleValuedProperty array whose SingleTypedProperty.getPropertyType()is identical to the type represented by the column. The SingleValuedProperty.getValue()returns the current value of the cell.
Throws:
MetadataException - - thrown if an error occurs or if the addition was refused. Tables may place limitations on what values may be added to them. A MetadataException must always be thrown in cases where the value addition was refused. Ideally, the message field of the MetadataException would indicate the reason for refusal.

createNewRow

SingleValuedProperty[] createNewRow(int index)
                                    throws MetadataException
Inserts a new row at the given row index. The values for this new row may be set by obtaining SingleValuedProperty instances for each cell in the row via calls to getCellProperty(int, int)or getRowProperties(int).

Parameters:
index - the desired row index. The index must be within the valid index range: 0 <= index < rowCount().
Returns:
a non null SingleValuedProperty array whose SingleTypedProperty.getPropertyType()is identical to the type represented by the column. The SingleValuedProperty.getValue()returns the current value of the cell.
Throws:
MetadataException - - thrown if an error occurs or if the addition was refused. Tables may place limitations on what values may be added to them. A MetadataException must always be thrown in cases where the value addition was refused. Ideally, the message field of the MetadataException would indicate the reason for refusal.

rowCount

int rowCount()
Returns the current total number of rows in the table.

Returns:
the current total number of rows in the table.