celeboss.ui
Class CelebrityTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byceleboss.ui.util.SortedTableModel
          extended byceleboss.ui.MonitorableTableModel
              extended byceleboss.ui.CelebrityTableModel
All Implemented Interfaces:
java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable, javax.swing.table.TableModel

public class CelebrityTableModel
extends MonitorableTableModel

This table model attaches to a Celebrity factory and display the celebrity details. It reacts to the dynamic changes to the CelebrityFactory and Celebrities.

Version:
1.0
Author:
bevans
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class celeboss.ui.MonitorableTableModel
MonitorableTableModel.ColumnSpec
 
Field Summary
static int DIVIDEND
          Potential dividend column
static int GROWTHHOUR
          Index of the Growth per hour column
static int GROWTHTODAY
          Index of the growth today column
static int GROWTHYESTERDAY
          Predicated price column
static int NAME
          Index of Name column
static int SHAREPRICE
          Share price column index
static int UPDATED
          Time of last update column
static int YIELD
          Index of the Yield column
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
CelebrityTableModel(java.util.Collection celebs)
          Create a model that holds a list of celebrities.
 
Method Summary
protected  java.lang.Object getCellValue(java.lang.Object row, int column)
          Get the value of a specific cell.
 
Methods inherited from class celeboss.ui.MonitorableTableModel
addObject, getColumnClass, getColumnCount, getColumnDescription, getColumnName, propertyChange, release, removeObject
 
Methods inherited from class celeboss.ui.util.SortedTableModel
addObject, cellUpdated, getRow, getRowCount, getRowId, getValueAt, removeObject, sortByColumn
 
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, toString, wait, wait, wait
 

Field Detail

NAME

public static final int NAME
Index of Name column

See Also:
Constant Field Values

GROWTHHOUR

public static final int GROWTHHOUR
Index of the Growth per hour column

See Also:
Constant Field Values

GROWTHTODAY

public static final int GROWTHTODAY
Index of the growth today column

See Also:
Constant Field Values

GROWTHYESTERDAY

public static final int GROWTHYESTERDAY
Predicated price column

See Also:
Constant Field Values

DIVIDEND

public static final int DIVIDEND
Potential dividend column

See Also:
Constant Field Values

YIELD

public static final int YIELD
Index of the Yield column

See Also:
Constant Field Values

SHAREPRICE

public static final int SHAREPRICE
Share price column index

See Also:
Constant Field Values

UPDATED

public static final int UPDATED
Time of last update column

See Also:
Constant Field Values
Constructor Detail

CelebrityTableModel

public CelebrityTableModel(java.util.Collection celebs)
Create a model that holds a list of celebrities. If any of the displaed properties change, at appropriate Table Cell updated event will be generated for the corresponding event. Other celebrities can be added and removed later.

Parameters:
celebs - List of celebrities to display
Method Detail

getCellValue

protected java.lang.Object getCellValue(java.lang.Object row,
                                        int column)
Get the value of a specific cell.

Specified by:
getCellValue in class SortedTableModel
Parameters:
row - The object at the required row.
column - The id of the column.
Returns:
The object value of the cell.