edu.wpi.cs.dsrg.xmldb.xat.component.gui.utils
Class StatsTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--edu.wpi.cs.dsrg.xmldb.xat.component.gui.utils.StatsTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class StatsTableModel
extends javax.swing.table.AbstractTableModel

The table model for the statistic tables. The constructor's GUI parameter is required for the association between the StatsTableModel and the GUI. This was needed in order to get the user's selected statistics and retrieve these statistic values from StatisticStorage.

Author:
Maylene Waltz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
StatsTableModel(GUI gui)
          Constructor associates the given gui with this table model.
 
Method Summary
 int getColumnCount()
          Returns the number of columns in the table.
 java.lang.String[] getColumnHeaders()
          Returns the table's column headers.
 int getRowCount()
          Returns the number of rows in the table.
 java.lang.Object getValueAt(int row, int col)
          Returns the Object located at the given row and col.
 java.lang.Object[][] update(java.lang.Object queryObject)
          Updates the table's data.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, 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

StatsTableModel

public StatsTableModel(GUI gui)
Constructor associates the given gui with this table model.

Parameters:
gui - the GUI to associate with this table model
Method Detail

getColumnCount

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

Returns:
the number of columns in the table

getColumnHeaders

public java.lang.String[] getColumnHeaders()
Returns the table's column headers.

Returns:
the table's column headers

getRowCount

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

Returns:
the number of rows in the table

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Returns the Object located at the given row and col.

Parameters:
row - the row with the desired Object
col - the column with the desired Object
Returns:
the Object at the given row and column

update

public java.lang.Object[][] update(java.lang.Object queryObject)
Updates the table's data. There is a row for each of the user's selected statistic(s) and a column for all available statistic values. The most recent statistic value is the left most column progressing to the right with earlier statistic values.

Parameters:
queryObject - the query object which we are updating the statistic table for
Returns:
the table's data