Venice 0.7beta

org.mov.table
Class PortfolioModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.mov.ui.AbstractTableModel
          extended by org.mov.table.PortfolioModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class PortfolioModel
extends AbstractTableModel

Table model to display a portfolio to the user. The model tells a table how to display the portfolio by describing the columns and how to populate the table.

Author:
Andrew Leppard
See Also:
Column, Serialized Form

Field Summary
static int CASH_VALUE_COLUMN
          Portfolio cash value column number.
static int DATE_COLUMN
          Date column number.
static int MARKET_VALUE_CHANGE_COLUMN
          Portfolio value change column number.
static int MARKET_VALUE_COLUMN
          Portfolio value column number.
static int PERCENT_CHANGE_COLUMN
          Portfolio percent change column number.
static int RETURN_VALUE_COLUMN
          Portfolio return column number.
static int SHARE_VALUE_COLUMN
          Portfolio share value column number.
static int STOCKS_HELD_COLUMN
          Stocks held column number.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PortfolioModel(Portfolio portfolio, EODQuoteBundle quoteBundle)
          Create a new portfolio model.
 
Method Summary
 int getRowCount()
          Return the number of rows in the table.
 java.lang.Object getValueAt(int row, int column)
          Return the value at the given table cell.
 
Methods inherited from class org.mov.ui.AbstractTableModel
getColumn, getColumnClass, getColumnCount, getColumnName, setColumns
 
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

DATE_COLUMN

public static final int DATE_COLUMN
Date column number.

See Also:
Constant Field Values

STOCKS_HELD_COLUMN

public static final int STOCKS_HELD_COLUMN
Stocks held column number.

See Also:
Constant Field Values

CASH_VALUE_COLUMN

public static final int CASH_VALUE_COLUMN
Portfolio cash value column number.

See Also:
Constant Field Values

SHARE_VALUE_COLUMN

public static final int SHARE_VALUE_COLUMN
Portfolio share value column number.

See Also:
Constant Field Values

MARKET_VALUE_COLUMN

public static final int MARKET_VALUE_COLUMN
Portfolio value column number.

See Also:
Constant Field Values

RETURN_VALUE_COLUMN

public static final int RETURN_VALUE_COLUMN
Portfolio return column number.

See Also:
Constant Field Values

MARKET_VALUE_CHANGE_COLUMN

public static final int MARKET_VALUE_CHANGE_COLUMN
Portfolio value change column number.

See Also:
Constant Field Values

PERCENT_CHANGE_COLUMN

public static final int PERCENT_CHANGE_COLUMN
Portfolio percent change column number.

See Also:
Constant Field Values
Constructor Detail

PortfolioModel

public PortfolioModel(Portfolio portfolio,
                      EODQuoteBundle quoteBundle)
Create a new portfolio model.

Parameters:
portfolio - The Portfolio to table
quoteBundle - Quote Bundle. The quote bundle may be null, but only if the portfolio has never performed any trades.
Method Detail

getRowCount

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

Returns:
Number of rows in table.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Return the value at the given table cell.

Parameters:
row - Row number.
column - Column number.
Returns:
Value to display in cell.

Venice 0.7beta