com.sas.table
Interface ColumnTemplateTableInterface

All Superinterfaces:
StaticColumnTemplateTableInterface, StaticTableInterface, TableInterface

public interface ColumnTemplateTableInterface
extends StaticColumnTemplateTableInterface, TableInterface

Defines an interface for modifying column template tables. Column template tables are tables where the set of row classes defines a template for each column. In other words, the class of each cell is restricted to the class, or a subclass, of its corresponding row. A transposed SAS data set is an example of such a table.

See Also:
RowTemplateTableInterface, FreeformTableInterface

Field Summary
static int DEFAULT_INDEX
          Default index constant.
 
Method Summary
 void addColumn(int index)
          Adds a default column.
 void addColumn(int index, java.lang.Object[] values)
          Adds a column.
 void addRow(int index, java.lang.Class cellClass, java.lang.Object defaultValue)
          Adds a row.
 void deleteColumn(int index)
          Deletes a column.
 void deleteRow(int index)
          Deletes a row.
 java.lang.Object getRowDefaultValue(int index)
          Returns the default value associated with a row.
 java.lang.Object[] getRowDefaultValues(int startIndex, int count)
          Returns the default values associated with a range of rows.
 boolean isColumnsDeletable()
          Returns the value of the columnsDeletable property.
 boolean isColumnsExtendable()
          Returns the value of the columnsExtendable property.
 boolean isColumnsInsertable()
          Returns the value of the columnsInsertable property.
 boolean isRowsDeletable()
          Returns the value of the rowsDeletable property.
 boolean isRowsExtendable()
          Returns the value of the rowsExtendable property.
 boolean isRowsInsertable()
          Returns the value of the rowsInsertable property.
 boolean isRowsRedefinable()
          Returns the value of the rowsRedefinable property.
 void setRowClass(int index, java.lang.Class newValue)
          Sets the class of a row.
 void setRowDefaultValue(int index, java.lang.Object newValue)
          Sets the default value associated with a row.
 
Methods inherited from interface com.sas.table.StaticColumnTemplateTableInterface
getRowClass, getRowClasses
 
Methods inherited from interface com.sas.table.TableInterface
isCellsModifiable, isMultipleColumnUpdateSupported, isMultipleRowUpdateSupported, setCell, setCells, setColumn, setRow
 
Methods inherited from interface com.sas.table.StaticTableInterface
countColumns, countRows, getCell, getCellClass, getCellClasses, getCells, getColumn, getColumnCount, getRow, getRowCount
 

Field Detail

DEFAULT_INDEX

static final int DEFAULT_INDEX
Default index constant. Use as the index with addRow and addColumn to add at the default position (usually the end).

See Also:
Constant Field Values
Method Detail

addColumn

void addColumn(int index)
               throws com.sas.table.TableException
Adds a default column. The new column is inserted at the given index and its cells are assigned the default value associated with their column.

Some implementations may not allow columns to be added. This can be determined through isColumnsExtendable. Some implementations may allow columns to be added, but not inserted; check isColumnsInsertable. If this is the case, only DEFAULT_INDEX can be specified for index.

Parameters:
index - The one-based position at which to insert the column; columns already at or above that position will be shifted-up. If DEFAULT_INDEX is specified the position of the new column is implementation defined, but should be at the end if possible.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

addColumn

void addColumn(int index,
               java.lang.Object[] values)
               throws com.sas.table.TableException
Adds a column. The new column is inserted at the given index and its cells are assigned the given values. The class of each element in the values array must be the same as or derived from the class of its corresponding row.

Some implementations may not allow columns to be added. This can be determined through isColumnsExtendable. Some implementations may allow columns to be added, but not inserted; check isColumnsInsertable. If this is the case, only DEFAULT_INDEX can be specified for index.

Parameters:
index - The one-based position at which to insert the column; columns already at or above that position will be shifted-up. If DEFAULT_INDEX is specified the position of the new column is implementation defined, but should be at the end if possible.
values - The values for each of the column's cells. If values is null, each cell will be assigned its corresponding row's default value.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

addRow

void addRow(int index,
            java.lang.Class cellClass,
            java.lang.Object defaultValue)
            throws com.sas.table.TableException
Adds a row. The new row is inserted at the given index and assigned the given class and defaultValue.

Some implementations may not allow rows to be added. This can be determined through isRowsExtendable. Some implementations may allow rows to be added, but not inserted; check isRowsInsertable. If this is the case, only DEFAULT_INDEX can be specified for index.

Parameters:
index - The one-based position at which to insert the row; rows already at or above that position will be shifted-up. If DEFAULT_INDEX is specified the position of the new row is implementation defined, but should be at the end if possible.
cellClass - The class of the row's cells.
defaultValue - The default value for the row's cells.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

deleteColumn

void deleteColumn(int index)
                  throws com.sas.table.TableException
Deletes a column. The column is identified by the given index.

Some implementations may not allow columns to be deleted. This can be determined through isColumnsDeletable.

Parameters:
index - A one-based index that identifies the column.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.
java.lang.IndexOutOfBoundsException - Thrown if index is negative, zero, or greater than the number of columns.

deleteRow

void deleteRow(int index)
               throws com.sas.table.TableException
Deletes a row. The row is identified by the given index.

Some implementations may not allow rows to be deleted. This can be determined through isRowsDeletable.

Parameters:
index - A one-based index that identifies the row.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.
java.lang.IndexOutOfBoundsException - Thrown if index is negative, zero, or greater than the number of rows.

getRowDefaultValue

java.lang.Object getRowDefaultValue(int index)
                                    throws com.sas.table.TableException
Returns the default value associated with a row. The row is identified by the given index. The default value is used as the value for cells in the row which are not assigned values of their own.

Parameters:
index - A one-based index that identifies the row.
Returns:
The row's default value.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.
java.lang.IndexOutOfBoundsException - Thrown if index is negative, zero, or greater than the number of rows.

getRowDefaultValues

java.lang.Object[] getRowDefaultValues(int startIndex,
                                       int count)
                                       throws com.sas.table.TableException
Returns the default values associated with a range of rows. The range of rows is identified by the given index which serves to identify a starting row and by the given row count which defines the extent of the range. The set of default values is returned as an array with each element of the array corresponding to a row in the range.

Parameters:
startIndex - A one-based index which identifies the start of the range.
count - The number of default values to return; defines the extent of the range.
Returns:
The specified rows' default values.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.
java.lang.IndexOutOfBoundsException - Thrown if startIndex or count is negative, zero, or greater than the number of rows except when getRowCount has returned -1. In that case, the implementation should return an array whose length is less than count and the caller should be prepared for this.

isColumnsDeletable

boolean isColumnsDeletable()
                           throws com.sas.table.TableException
Returns the value of the columnsDeletable property. columnsDeletable indicates whether or not columns can be deleted; see deleteColumn.

Returns:
True if columns can be deleted, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isColumnsExtendable

boolean isColumnsExtendable()
                            throws com.sas.table.TableException
Returns the value of the columnsExtendable property. columnsExtendable indicates whether or not the set of columns can be extended or added to; see addColumn.

Returns:
True if new columns can be added, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isColumnsInsertable

boolean isColumnsInsertable()
                            throws com.sas.table.TableException
Returns the value of the columnsInsertable property. columnsInsertable indicates whether or not new columns can be inserted into the existing set; see addColumn.

Returns:
True if new columns can be inserted, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isRowsDeletable

boolean isRowsDeletable()
                        throws com.sas.table.TableException
Returns the value of the rowsDeletable property. rowsDeletable indicates whether or not rows can be deleted; see deleteRow.

Returns:
True if rows can be deleted, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isRowsExtendable

boolean isRowsExtendable()
                         throws com.sas.table.TableException
Returns the value of the rowsExtendable property. rowsExtendable indicates whether or not the set of rows can be extended or added to; see addRow.

Returns:
True if new rows can be added, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isRowsInsertable

boolean isRowsInsertable()
                         throws com.sas.table.TableException
Returns the value of the rowsInsertable property. rowsInsertable indicates whether or not new rows can be inserted into the existing set; see addRow.

Returns:
True if new rows can be inserted, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

isRowsRedefinable

boolean isRowsRedefinable()
                          throws com.sas.table.TableException
Returns the value of the rowsRedefinable property. rowsRedefinable indicates whether or not rows can be redefined; see setRowClass.

Returns:
True if rows can be redefined, false otherwise.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

setRowDefaultValue

void setRowDefaultValue(int index,
                        java.lang.Object newValue)
                        throws com.sas.table.TableException
Sets the default value associated with a row. The row is identified by the given index. The default value is used as the value for cells in the row which are not assigned values of their own.

Parameters:
index - A one-based index that identifies the row.
newValue - The new defaultValue to associate with the row.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.
java.lang.IndexOutOfBoundsException - Thrown if index is negative, zero, or greater than the number of rows.

setRowClass

void setRowClass(int index,
                 java.lang.Class newValue)
                 throws com.sas.table.TableException
Sets the class of a row. The row is identified by the given index. Since all rows are assigned a class when they are created (see addRow), setting the class is equivalent to redefining the row. The class may be relaxed, restricted, or changed entirely depending on the flexibility of the implementation. An example of relaxing the class is changing a row of Strings to be a row of Objects. Restricting the class is shown by changing a row of Doubles to be Integers.

Some implementations may not allow rows to be redefined. This can be determined through isRowsRedefinable.

Parameters:
index - A one-based index that identifies the row.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.
java.lang.IndexOutOfBoundsException - Thrown if index is negative, zero, or greater than the number of rows.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.