NextApp Echo
1.0.5

nextapp.echo.table
Class DefaultTableModel

java.lang.Object
  extended bynextapp.echo.table.AbstractTableModel
      extended bynextapp.echo.table.DefaultTableModel
All Implemented Interfaces:
java.io.Serializable, TableModel

public class DefaultTableModel
extends AbstractTableModel
implements java.io.Serializable

The default TableModel implementation.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class nextapp.echo.table.AbstractTableModel
listenerList
 
Constructor Summary
DefaultTableModel()
          Creates a new table model of 0x0 size.
DefaultTableModel(int columns, int rows)
          Creates a new table model of the specified dimension.
DefaultTableModel(java.lang.Object[][] data, java.lang.Object[] names)
          Creates a new Table Model with the specified data and column names.
 
Method Summary
 void deleteRow(int row)
          Deletes the specified row.
 int getColumnCount()
          Returns the number of columns in the table.
 java.lang.String getColumnName(int column)
          Returns the name of the specified column number.
 int getRowCount()
          Returns the number of rows in the table.
 java.lang.Object getValueAt(int column, int row)
          Returns the contents of the table at the specified position.
 void insertRow(int row, java.lang.Object[] rowData)
          Inserts a row with the provided data.
 void setColumnCount(int newValue)
          Sets the number of columns in the table.
 void setRowCount(int newValue)
          Sets the number of rows in the table.
 void setValueAt(java.lang.Object newValue, int column, int row)
          Sets the contents of the table at the specified coordinate.
 
Methods inherited from class nextapp.echo.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTableModel

public DefaultTableModel()
Creates a new table model of 0x0 size.


DefaultTableModel

public DefaultTableModel(int columns,
                         int rows)
Creates a new table model of the specified dimension.

Parameters:
columns - The number of columns in the table model.
rows - The number of rows in the table model.

DefaultTableModel

public DefaultTableModel(java.lang.Object[][] data,
                         java.lang.Object[] names)
Creates a new Table Model with the specified data and column names.

Parameters:
data - A two dimensional array containing the table data. The first index divides the array into rows. The second index specifies columns.
names - An array of column names.
Method Detail

deleteRow

public void deleteRow(int row)
Deletes the specified row.

Parameters:
row - The row to delete.

getColumnCount

public int getColumnCount()
Returns the number of columns in the table.

Specified by:
getColumnCount in interface TableModel
Returns:
The number of columns in the table.

getColumnName

public java.lang.String getColumnName(int column)
Returns the name of the specified column number.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
column - The column number whose name is to be returned.
Returns:
The name of the specified column number.

getRowCount

public int getRowCount()
Returns the number of rows in the table.

Specified by:
getRowCount in interface TableModel
Returns:
The number of rows in the table.

getValueAt

public java.lang.Object getValueAt(int column,
                                   int row)
Returns the contents of the table at the specified position.

Specified by:
getValueAt in interface TableModel
Parameters:
row - The row index of the desired value.
column - The column index of the desired value.
Returns:
The value of the specified cell.

insertRow

public void insertRow(int row,
                      java.lang.Object[] rowData)
Inserts a row with the provided data.

Parameters:
row - The index of the inserted row.
rowData - The data for the new.

setColumnCount

public void setColumnCount(int newValue)
Sets the number of columns in the table. Empty columns will be added at the end of the table if the new column count exceeds the number of existing columns. Existing columns will be hidden if the number of existing columns exceeds the new column count.

Parameters:
newValue - The new number of columns in the table.

setRowCount

public void setRowCount(int newValue)
Sets the number of rows in the table. Empty rows will be added at the end of the table if the new row count exceeds the number of existing rows. Existing rows will be hidden if the number of existing rows exceeds the new row count.

Parameters:
newValue - The new number of rows in the table.

setValueAt

public void setValueAt(java.lang.Object newValue,
                       int column,
                       int row)
Sets the contents of the table at the specified coordinate.

Parameters:
newValue - The new value for the given cell.
column - The column at which to place the value.
row - The row at which to place the value.

NextApp Echo
1.0.5