All Packages Class Hierarchy This Package Previous Next Index
Class COM.taligent.util.TableModel
java.lang.Object
|
+----COM.taligent.util.TableModel
- public abstract class TableModel
- extends Object
- implements DataModel
A representation of a table with rows, columns, and information
associated with columns and rows. The TableModel contains the
basic methods needed to access and modify the table's contents.
- Version:
- 1.0
- Author:
- Andy Clark, Taligent Inc.
-
TableModel()
-
-
addColumn(Object[], Object)
- Adds a column.
-
addRow(Object[], Object)
- Adds a row.
-
addTableListener(TableListener)
- Adds a table listener.
-
getColumnCount()
- Returns the number of columns in the table.
-
getColumnIndex(Object)
- Returns the index of the first column information that equals
the specified information or -1 if no column information matches.
-
getColumnInfo(int)
- Returns the specified column's information.
-
getElement(int, int)
- Returns the element at the specified <row, col>.
-
getRowCount()
- Returns the number of rows in the table.
-
getRowIndex(Object)
- Returns the index of the first row information that equals
the specified information or -1 if no column information matches.
-
getRowInfo(int)
- Returns the specified row's information.
-
insertColumn(Object[], Object, int)
- Inserts a column at the specified index.
-
insertRow(Object[], Object, int)
- Insert a row at the specified index.
-
removeAllColumns()
- Removes all of the columns in the table.
-
removeAllRows()
- Removes all of the rows in the table.
-
removeColumn(int)
- Removes the specified column.
-
removeRow(int)
- Removes specified row.
-
removeTableListener(TableListener)
- Removes the specified table listener.
-
replaceColumn(Object[], Object, int)
- Replace the column at the specified index.
-
replaceRow(Object[], Object, int)
- Replaces the row at the specified index.
-
setColumnInfo(Object, int)
- Sets the specified column's information.
-
setElement(Object, int, int)
- Sets the element at the specified <row, col>.
-
setRowInfo(Object, int)
- Sets the specified row's information.
TableModel
public TableModel()
addTableListener
public abstract void addTableListener(TableListener listener)
- Adds a table listener.
removeTableListener
public abstract void removeTableListener(TableListener listener)
- Removes the specified table listener.
setElement
public abstract void setElement(Object element,
int row,
int col)
- Sets the element at the specified <row, col>. The implementer
of this method should send TableEvent.ELEMENT_CHANGED events
to the registered table listeners.
- Parameters:
- element - The new element.
- row - The row index.
- col - The column index.
getElement
public abstract Object getElement(int row,
int col)
- Returns the element at the specified <row, col>.
- Parameters:
- row - The row index.
- col - The column index.
getColumnCount
public abstract int getColumnCount()
- Returns the number of columns in the table.
setColumnInfo
public abstract void setColumnInfo(Object info,
int col)
- Sets the specified column's information. The implementer of
this method should send TableEvent.COLUMN_INFO_CHANGED events
to the registered table listeners.
- Parameters:
- info - The column information.
- col - The column index.
getColumnInfo
public abstract Object getColumnInfo(int col)
- Returns the specified column's information.
- Parameters:
- col - The column index.
getColumnIndex
public abstract int getColumnIndex(Object info)
- Returns the index of the first column information that equals
the specified information or -1 if no column information matches.
- Parameters:
- info - The column information.
addColumn
public abstract void addColumn(Object data[],
Object info)
- Adds a column. The implementer of this method should send
TableEvent.COLUMN_ADDED events to the registered table
listeners.
- Parameters:
- data - The new column's data. Can be null. If the data
array length is shorter than the number of rows,
then null values will be added; and if the length
is greater than the number of rows, the extraneous
values are ignored.
- info - The new column's information. Can be null.
removeColumn
public abstract void removeColumn(int col)
- Removes the specified column. The implementer of this method
should send TableEvent.COLUMN_REMOVED events to the registered
table listeners.
- Parameters:
- col - The column index.
removeAllColumns
public abstract void removeAllColumns()
- Removes all of the columns in the table. The implementer of
this method should send TableEvent.COLUMN_REMOVED events to the
registered table listeners. To signify that all columns were
removed, the event column should be set to
TableEvent.ALL_COLUMNS.
insertColumn
public abstract void insertColumn(Object data[],
Object info,
int col)
- Inserts a column at the specified index. The implementer of
this method should send TableEvent.COLUMN_INSERTED events to
the registered table listeners.
- Parameters:
- data - The new column's data. Can be null. If the data
array length is shorter than the number of rows,
then null values will be added; and if the length
is greater than the number of rows, the extraneous
values are ignored.
- info - The new column's information. Can be null.
- col - The column index.
replaceColumn
public abstract void replaceColumn(Object data[],
Object info,
int col)
- Replace the column at the specified index. The implementer of
this method should send TableEvent.COLUMN_CHANGED events to
the registered table listeners.
- Parameters:
- data - The column's new data. Can be null. If the data
array length is shorter than the number of rows,
then null values will be added; and if the length
is greater than the number of rows, the extraneous
values are ignored.
- info - The column's new information. Can be null.
- col - The column index.
getRowCount
public abstract int getRowCount()
- Returns the number of rows in the table.
setRowInfo
public abstract void setRowInfo(Object info,
int row)
- Sets the specified row's information. The implementer of
this method should send TableEvent.ROW_INFO_CHANGED events
to the registered table listeners.
- Parameters:
- info - The row information.
- row - The row index.
getRowInfo
public abstract Object getRowInfo(int row)
- Returns the specified row's information.
- Parameters:
- row - The row index.
getRowIndex
public abstract int getRowIndex(Object info)
- Returns the index of the first row information that equals
the specified information or -1 if no column information matches.
- Parameters:
- info - The row information.
addRow
public abstract void addRow(Object data[],
Object info)
- Adds a row. The implementer of this method should send
TableEvent.ROW_ADDED events to the registered table listeners.
- Parameters:
- data - The new row's data. Can be null. If the data
array length is shorter than the number of
columns, then null values will be added; and if
the length is greater than the number of columns,
the extraneous values are ignored.
- info - The new row's information. Can be null.
removeRow
public abstract void removeRow(int row)
- Removes specified row. The implementer of this method should
send TableEvent.ROW_REMOVED events to the registered table
listeners.
- Parameters:
- row - The row index.
removeAllRows
public abstract void removeAllRows()
- Removes all of the rows in the table. The implementer of
this method should send TableEvent.ROW_REMOVED events to the
registered table listeners. To signify that all rows were
removed, the event row should be set to
TableEvent.ALL_ROWS.
insertRow
public abstract void insertRow(Object data[],
Object info,
int row)
- Insert a row at the specified index. The implementer of this
method should send TableEvent.ROW_INSERTED events to the
registered table listeners.
- Parameters:
- data - The new row's data. Can be null. If the data
array length is shorter than the number of
columns, then null values will be added; and if
the length is greater than the number of columns,
the extraneous values are ignored.
- info - The new row's information. Can be null.
- row - The row index.
replaceRow
public abstract void replaceRow(Object data[],
Object info,
int row)
- Replaces the row at the specified index. The implementer of
this method should send TableEvent.ROW_CHANGED events to the
registered table listeners.
- Parameters:
- data - The row's new data. Can be null. If the data
array length is shorter than the number of
columns, then null values will be added; and if
the length is greater than the number of columns,
the extraneous values are ignored.
- info - The row's new information. Can be null.
- row - The row index.
All Packages Class Hierarchy This Package Previous Next Index