net.bluebones.boggle
Class ScoreTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by net.bluebones.boggle.ScoreTableModel
All Implemented Interfaces:
Serializable, TableModel

public class ScoreTableModel
extends AbstractTableModel

TableModel for the table of scores in ScorePanel.

Version:
0.3 $Revision: 1.3 $
Author:
Thomas David Baker
See Also:
ScorePanel, TableModel, Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ScoreTableModel(Rubber r)
          Initializes a new ScoreTableModel with the specified values.
 
Method Summary
 NamedClient getClientAt(int row)
          Gets the NamedClient represented in the specified row.
 int getColumnCount()
          Gets the number of columns in the table data.
 String getColumnName(int i)
          Gets the name of the column at position i.
 int getRowCount()
          Gets the number of rows in the table data.
 Object getValueAt(int row, int col)
          Gets the cell contents at row, col.
 
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

ScoreTableModel

public ScoreTableModel(Rubber r)
Initializes a new ScoreTableModel with the specified values.

Parameters:
r - Rubber containing values to initialize the model with.
Method Detail

getColumnCount

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

Returns:
int number of columns in the table data.

getRowCount

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

Returns:
int number of rows in the table data.

getColumnName

public String getColumnName(int i)
Gets the name of the column at position i.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
i - int column number to return name of.
Returns:
String name of column.

getValueAt

public Object getValueAt(int row,
                         int col)
Gets the cell contents at row, col.

Parameters:
row - int row number.
col - int col number.
Returns:
Object value in specified cell.

getClientAt

public NamedClient getClientAt(int row)
Gets the NamedClient represented in the specified row.

Parameters:
row - int row number.
Returns:
NamedClient for specified row.
Throws:
IllegalStateException - If no clients have been set in this model.