jgnash.ui.register.table
Class SortedTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
jgnash.ui.register.table.AbstractRegisterTableModel
jgnash.ui.register.table.RegisterTableModel
jgnash.ui.register.table.SortedTableModel
- All Implemented Interfaces:
- java.io.Serializable, javax.swing.table.TableModel, MessageListener, AccountTableModel, PackableTableModel, SortableTableModel
- Direct Known Subclasses:
- SortedNegatedTableModel
public class SortedTableModel
- extends RegisterTableModel
- implements SortableTableModel
Sortable table model
- Version:
- $Id$
- Author:
- Craig Cavanaugh
- See Also:
- Serialized Form
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Methods inherited from class jgnash.ui.register.table.AbstractRegisterTableModel |
dispose, getAccount, getColumnClass, getColumnCount, getColumnMapping, getColumnName, getColumnNames, getColumnVisibility, getPreferredColumnWeights, getReconcileSymbol, getValueAt, isColumnVisible, setColumnVisibility, setColumnVisible, setPreferredColumnWeigths, setReconcileSymbol |
| 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 |
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
transactions
java.util.List<Transaction> transactions
sortColumn
private int sortColumn
ascending
private boolean ascending
sortedColumnMap
private boolean[] sortedColumnMap
sortColumns
private boolean[] sortColumns
comparator
private java.util.Comparator<Transaction> comparator
lock
final java.lang.Object lock
SortedTableModel
public SortedTableModel(Account account,
java.lang.String[] names)
getSortableColumns
private boolean[] getSortableColumns()
buildColumnMap
protected void buildColumnMap()
- Overrides the super to build the sort column map
- Overrides:
buildColumnMap in class AbstractRegisterTableModel
- See Also:
AbstractRegisterTableModel.buildColumnMap()
getTransactions
private void getTransactions()
- Creates a private clone of the account's transactions
getRowCount
public int getRowCount()
- Specified by:
getRowCount in interface javax.swing.table.TableModel- Overrides:
getRowCount in class AbstractRegisterTableModel
getTransactionAt
public Transaction getTransactionAt(int index)
- Overrides:
getTransactionAt in class AbstractRegisterTableModel
indexOf
public int indexOf(Transaction t)
- Overrides:
indexOf in class AbstractRegisterTableModel
getBalanceAt
public java.math.BigDecimal getBalanceAt(int index)
- Get the account balance up to a specified index.
- Overrides:
getBalanceAt in class AbstractRegisterTableModel
- Parameters:
index - the balance of this account at the specified index.
- Returns:
- the balance of the account at the specified index.
messagePosted
public void messagePosted(Message event)
- this override the update in AbstractRegisterTableModel to improve
performance
- Specified by:
messagePosted in interface MessageListener- Overrides:
messagePosted in class AbstractRegisterTableModel
addTransaction
private void addTransaction(Transaction t)
removeTransaction
private void removeTransaction(Transaction t)
isSortable
public boolean isSortable(int col)
- Specified by:
isSortable in interface SortableTableModel
sortColumn
public void sortColumn(int col,
boolean ascending1)
- Specified by:
sortColumn in interface SortableTableModel
getSortedColumn
public int getSortedColumn()
- Specified by:
getSortedColumn in interface SortableTableModel
getAscending
public boolean getAscending()
- Specified by:
getAscending in interface SortableTableModel