com.sas.table
Interface FreeformTableInterface

All Superinterfaces:
StaticTableInterface, TableInterface

public interface FreeformTableInterface
extends TableInterface

Defines an interface for modifying freeform tables. Freeform tables are tables where each cell is independent of every other cell. This independence allows each cell to have its own class and contrasts with traditional database tables, for example (see RowTemplateTableInterface), where the class of each cell is defined by its column. Spreadsheets are often examples of freeform tables.

See Also:
ColumnTemplateTableInterface, RowTemplateTableInterface

Method Summary
 void addColumn(int index, java.lang.Object[] values)
          Adds a column.
 void addRow(int index, java.lang.Object[] values)
          Adds a row.
 void deleteColumn(int index)
          Deletes a column.
 void deleteRow(int index)
          Deletes a row.
 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.
 void setCellClass(int rowIndex, int columnIndex, java.lang.Class newClass)
          Sets the class of a cell.
 void setCellClasses(int startRowIndex, int startColumnIndex, int rowCount, int columnCount, java.lang.Class[][] classes)
          Sets the classes for a block of cells.
 void setSize(int rowCount, int columnCount)
          Sets the size of the table.
 
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
 

Method Detail

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.

Some implementations may not allow columns to be added. This can be determined through isColumnsExtendable.

Parameters:
index - The one-based position at which to insert the column.
values - The values for each of the column's cells.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.

addRow

void addRow(int index,
            java.lang.Object[] values)
            throws com.sas.table.TableException
Adds a row. The new row is inserted at the given index and its cells are assigned the given values.

Some implementations may not allow rows to be added. This can be determined through isRowsExtendable.

Parameters:
index - The one-based position at which to insert the row.
values - The values for each of 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.

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.

setCellClass

void setCellClass(int rowIndex,
                  int columnIndex,
                  java.lang.Class newClass)
                  throws com.sas.table.TableException
Sets the class of a cell. The cell is identified by the given row and column indices.

Parameters:
rowIndex - A one-based index that identifies the cell's row.
columnIndex - A one-based index that identifies the cell's column.
newClass - The new class to associate with the cell.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.
java.lang.IndexOutOfBoundsException - Thrown if rowIndex is negative, zero, or greater than the number of rows. Thrown if columnIndex is negative, zero, or greater than the number of columns.

setCellClasses

void setCellClasses(int startRowIndex,
                    int startColumnIndex,
                    int rowCount,
                    int columnCount,
                    java.lang.Class[][] classes)
                    throws com.sas.table.TableException
Sets the classes for a block of cells. The block is identified by the intersection of a range of rows with a range of columns. startRowIndex and rowCount define the start and extent of the row range while startColumnIndex and columnCount define the column range. The set of new classes is specified as a two-dimensional array with each element of the array corresponding to a cell in the block (e.g. newClasses[0][0] contains the class of cell(startRowIndex, startColumnIndex)).

Parameters:
startRowIndex - A one-based index that identifies the start of the row range.
startColumnIndex - A one-based index that identifies the start of the column range.
rowCount - The number of rows in the row range.
columnCount - The number of columns in the column range.
newClasses - The new classes to associate with the cells.
Throws:
TableException - Provides a catch-all for all non-RuntimeExceptions.
java.lang.IndexOutOfBoundsException - Thrown if the row range extends beyond the number of available rows or if the column range extends beyond the number of available columns.

setSize

void setSize(int rowCount,
             int columnCount)
Sets the size of the table. The default class and value of new cells is implementation defined. Whether an existing table can be made smaller is indicated by isColumnsDeletable and isRowsDeletable. Whether an existing table can be made larger is indicated by isColumnsExtendable and isRowsExtendable.

Parameters:
rowCount - The number of rows to create in the table.
columnCount - The number of columns to create in the table.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.