net.sf.jga.swing

Class SpreadsheetTableModel

public class SpreadsheetTableModel extends AbstractTableModel

TableModel that uses a sparse matrix of functors. The matrix is keyed by the (row,col) coordinates.

There will likely be a Cell class that represents the boxes in the table: in addition to the functor, each cell will likely have a Format, and there is likely to be some bookkeeping state used in the recalculation logic. The first major problem to be solved before this class is really ready to go is how to represent Cell & Range references as functors.

The longer term problem that I intend to get to is a language that allows the user to enter formulas into this table. Until that is done, the these tables can only be built programatically (which is somewhat useful, but obviously less than optimal).

Copyright © 2003 David A. Hall

Author: David A. Hall

Constructor Summary
SpreadsheetTableModel()
SpreadsheetTableModel(int rows, int cols)
Method Summary
intgetColumnCount()
intgetRowCount()
ObjectgetValueAt(int row, int col)
voidsetValueAt(Object value, int row, int col)

Constructor Detail

SpreadsheetTableModel

public SpreadsheetTableModel()

SpreadsheetTableModel

public SpreadsheetTableModel(int rows, int cols)

Method Detail

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getValueAt

public Object getValueAt(int row, int col)

setValueAt

public void setValueAt(Object value, int row, int col)