org.afcs.warts.gui
Class TableDescriptionModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.afcs.warts.gui.TableDescriptionModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public final class TableDescriptionModel
extends javax.swing.table.AbstractTableModel

The TableDescriptionModel class wraps a TableDescription instance in an implementation of javax.swing.table.TableModel allowing GUIs to include a Swing version of the database table report generated by TableDescriptionReport .

LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.

Version:
Last Modified 18 September 2003
Author:
Warren Hedley ( whedley at sdsc dot edu )
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableDescriptionModel(TableDescription tableDescription)
          Creates a new instance with the specified database table description providing the data for the Swing table.
 
Method Summary
 int getColumnCount()
          Returns the number of columns in the model (which is always 6).
 java.lang.String getColumnName(int columnIndex)
          Returns the name of the specified column in the model.
 int getRowCount()
          Returns the number of rows in the table, which is equal to the number of columns in the database table.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Returns the data at in the table model at the specified row and column indices.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDescriptionModel

public TableDescriptionModel(TableDescription tableDescription)
Creates a new instance with the specified database table description providing the data for the Swing table.

Parameters:
tableDescription - The database table providing the data to model.
Throws:
java.lang.NullPointerException - If tableDescription is null.
Method Detail

getRowCount

public int getRowCount()
Returns the number of rows in the table, which is equal to the number of columns in the database table.

Returns:
The number of rows in the model.

getColumnCount

public int getColumnCount()
Returns the number of columns in the model (which is always 6).

Returns:
The number of columns in the model.

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Returns the data at in the table model at the specified row and column indices. The indices should be within the ranges specified by getRowCount() and getColumnCount().

Parameters:
rowIndex - The row to get data from.
columnIndex - The column to get data from.
Returns:
The data at in the table model at the specified row and column indices.

getColumnName

public java.lang.String getColumnName(int columnIndex)
Returns the name of the specified column in the model.

Parameters:
columnIndex - The column to get the name for.
Returns:
The name of the specified column in the model.