org.afcs.warts.gui
Class TabularDataTableModel

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

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

The TabularDataTableModel implements the javax.swing.table.TableModel interface for any classes implementing the TabularData interface. This allows the data available after a non-ascii character analysis or data comparison is performed to be conveniently displayed in a JTable.

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
TabularDataTableModel(TabularData tabularData)
          Constructs a new table model around the specified tabular data.
 
Method Summary
 java.lang.Class getColumnClass(int columnIndex)
          Returns the class of object in the specified column, which is obtained by looking for the first non-null object in the column and returning its class.
 int getColumnCount()
          Returns the number of columns in the base dataset.
 java.lang.String getColumnName(int columnIndex)
          Returns the name of the specified column.
 int getRowCount()
          Returns the number of rows in the base dataset.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Returns the value at the specified row and column in the base dataset.
 java.lang.String toString()
          Returns a text description of the current instance that can be used for debugging purposes.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TabularDataTableModel

public TabularDataTableModel(TabularData tabularData)
Constructs a new table model around the specified tabular data.

Parameters:
tabularData - The tabular data to be adapted.
Throws:
java.lang.NullPointerException - If tabularData is null.
Method Detail

getRowCount

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

Returns:
The number of rows in the comparison.

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Returns the class of object in the specified column, which is obtained by looking for the first non-null object in the column and returning its class.

Parameters:
columnIndex - The column to obtain the class for.
Returns:
The class of object in the specified column.
Throws:
java.lang.IllegalArgumentException - If columnIndex is out of bounds.

getColumnCount

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

Returns:
The number of columns in the base dataset.

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Returns the value at the specified row and column in the base dataset.

Parameters:
rowIndex - The row to return data from.
columnIndex - The column to return data from.
Returns:
The value at the specified row and column in the base dataset.
Throws:
java.lang.IllegalArgumentException - If either index is out of bounds.

getColumnName

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

Parameters:
columnIndex - The column to return the name of.
Returns:
The name of the specified column.
Throws:
java.lang.IllegalArgumentException - If columnIndex is out of bounds.

toString

public java.lang.String toString()
Returns a text description of the current instance that can be used for debugging purposes.

Returns:
A text description of the current instance that can be used for debugging purposes.