SandMark version 2.0


sandmark.gui
Class StatTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--sandmark.gui.StatTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class StatTableModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

Field Summary
(package private)  java.lang.Class[] columnClasses
           
(package private)  java.lang.String[] columnNames
           
(package private)  java.lang.Object[][] data
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
StatTableModel(Stats stats)
          Constructs the package level data representation.
StatTableModel(Stats stats, java.lang.String packageName)
          Constructs the class level data representation.
StatTableModel(java.lang.String className, Stats stats)
          Constructs the method level data representation.
 
Method Summary
 java.lang.Class getColumnClass(int c)
          Returns the Class of object at the first row of the cth column.
 int getColumnCount()
          Returns the number of colmuns.
 java.lang.String getColumnName(int col)
          Returns the title of the specified column
 java.lang.Object[][] getData()
          Gets the Object array that represents the data stored in the table.
 int getRowCount()
          Returns the current number of rows
 java.lang.Object getValueAt(int row, int col)
          Returns the value at the cell specified
 boolean isCellEditable(int r, int c)
          Returns true if the cell at row r, column c is editable, otherwise false.
 void setValueAt(java.lang.Object value, int row, int col)
          Sets the value in the table to the specified value.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

java.lang.String[] columnNames

data

java.lang.Object[][] data

columnClasses

java.lang.Class[] columnClasses
Constructor Detail

StatTableModel

public StatTableModel(Stats stats)
Constructs the package level data representation.

Parameters:
stats - the Statistics object with the data to display.

StatTableModel

public StatTableModel(Stats stats,
                      java.lang.String packageName)
Constructs the class level data representation.

Parameters:
stats - the Statistics object with the data to display.

StatTableModel

public StatTableModel(java.lang.String className,
                      Stats stats)
Constructs the method level data representation.

Parameters:
stats - the Statistics object with the data to display.
className - the name of the class for which to display method data.
Method Detail

getColumnCount

public int getColumnCount()
Returns the number of colmuns.

Returns:
returns the number of columns in the table

getRowCount

public int getRowCount()
Returns the current number of rows

Returns:
the number of rows in the table.

getColumnName

public java.lang.String getColumnName(int col)
Returns the title of the specified column

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
col - the column number (zero based index)
Returns:
the name of the column

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Returns the value at the cell specified

Parameters:
row - the row in the table
col - the column in the table
Returns:
the Object located at row, col in the table.

getColumnClass

public java.lang.Class getColumnClass(int c)
Returns the Class of object at the first row of the cth column. This is used to make determinations by the table about how to display the data.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
c - the column in the table for which to get the class
Returns:
the class type of the data in the column

isCellEditable

public boolean isCellEditable(int r,
                              int c)
Returns true if the cell at row r, column c is editable, otherwise false.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
r - a row in the table.
c - a column in the table.
Returns:
true if the cell at row r, column c is editable, otherwise false.

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Sets the value in the table to the specified value.

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
Parameters:
value - the value to insert into the table.
row - a row in the table

getData

public java.lang.Object[][] getData()
Gets the Object array that represents the data stored in the table.

Returns:
an Object[][] array which holds the data that is in the table.

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002