Venice 0.751beta

nz.org.venice.ui
Class AbstractQuoteModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bynz.org.venice.ui.AbstractTableModel
          extended bynz.org.venice.ui.AbstractQuoteModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
EODQuoteModel, MixedQuoteModel

public abstract class AbstractQuoteModel
extends AbstractTableModel

Helper for constructing quote table models. This abstract table model allows you to pass a list of columns for describing a table. The model append a list of expression columns that let the user apply expressions to quotes in the table. The model will then care care of returning information to the table about each column and recomputing the expression columns as necessary.

Author:
Andrew Leppard
See Also:
Column, ExpressionColumn, Serialized Form

Field Summary
static int EXPRESSION_COLUMN_COUNT
          The number of expression columns to display for tables that support them.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AbstractQuoteModel(QuoteBundle quoteBundle, java.util.List quotes, int firstExpressionColumn)
          Create a new quote table model with no columns.
 
Method Summary
 Column getColumn(int columnNumber)
          Return a column.
 int getColumnCount()
          Return the number of columns in the table.
 ExpressionColumn[] getExpressionColumns()
          Return the array of expression columns.
 java.util.List getQuotes()
          Return the list of quotes in the table.
 int getRowCount()
          Return the number of rows in the table.
 void setExpressionColumns(ExpressionColumn[] expressionColumns)
          Set the expression columns.
 void setQuotes(java.util.List quotes)
          Set the list of quotes to table.
 
Methods inherited from class nz.org.venice.ui.AbstractTableModel
getColumnClass, 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
 
Methods inherited from interface javax.swing.table.TableModel
getValueAt
 

Field Detail

EXPRESSION_COLUMN_COUNT

public static final int EXPRESSION_COLUMN_COUNT
The number of expression columns to display for tables that support them.

See Also:
Constant Field Values
Constructor Detail

AbstractQuoteModel

public AbstractQuoteModel(QuoteBundle quoteBundle,
                          java.util.List quotes,
                          int firstExpressionColumn)
Create a new quote table model with no columns.

Parameters:
quoteBundle - Quote bundle
quotes - A list of Quotes which contain the quote symbols and dates to table.
firstExpressionColumn - The column number of the first expression column.
Method Detail

getExpressionColumns

public ExpressionColumn[] getExpressionColumns()
Return the array of expression columns.

Returns:
Array of expression columns.
See Also:
Column, ExpressionColumn

setExpressionColumns

public void setExpressionColumns(ExpressionColumn[] expressionColumns)
Set the expression columns. This function also calculates their values.

Parameters:
expressionColumns - New expression columns

getColumnCount

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

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Overrides:
getColumnCount in class AbstractTableModel
Returns:
Number of columns in table.

getColumn

public Column getColumn(int columnNumber)
Return a column.

Overrides:
getColumn in class AbstractTableModel
Parameters:
columnNumber - Number of column.
Returns:
Column

getQuotes

public java.util.List getQuotes()
Return the list of quotes in the table.

Returns:
Tabled quotes.

setQuotes

public void setQuotes(java.util.List quotes)
Set the list of quotes to table.

Parameters:
quotes - New quotes to table.

getRowCount

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

Returns:
Number of rows in table.

Venice 0.751beta