public class SimpleSpreadSheet extends java.lang.Object implements ISpreadSheetModel
Note : the row and column label array lengths always determine the size of the spreadsheet. The cell values are adjusted accordingly. The cells are initially default to null, and are later assigned as provided in the cell array.
ISpreadSheetModel
Constructor and Description |
---|
SimpleSpreadSheet()
Default constructor
|
SimpleSpreadSheet(java.lang.Object[] rowVals,
java.lang.Object[] columnVals,
java.lang.Object[][] vals)
A more Convenient constructor that can support almost any type
|
SimpleSpreadSheet(java.lang.String[] rowVals,
java.lang.String[] columnVals,
java.lang.Double[][] vals)
Convenient constructor for strings and double spreadsheet
|
SimpleSpreadSheet(java.lang.String[] rowVals,
java.lang.String[] columnVals,
java.lang.Integer[][] vals)
Convenient constructor for strings and integer spreadsheet
|
Modifier and Type | Method and Description |
---|---|
void |
addSpreadSheetModelListener(ISpreadSheetModelListener l)
Adds the given listener to the listener list
|
protected void |
fireSpreadSheetChanged(SpreadSheetModelEvent e)
Notifies all listeners of the given event
|
int |
getColumnCount()
Get total number of cloumns
|
java.lang.Object |
getColumnLabel(int i)
Get the label for the given column
|
int |
getColumnLabelType()
Get the label type of the specified column
|
int |
getRowCount()
Get total number of rows
|
java.lang.Object |
getRowLabel(int i)
Get the label for the given row
|
int |
getRowLabelType()
Get the label type of the specified row
|
java.lang.Object |
getValueAt(int i,
int j)
Get the value at a given row and column indexes (beginning at 1)
|
int |
getValueType()
Get the type of the value
|
void |
removeSpreadSheetModelListener(ISpreadSheetModelListener l)
Removes the given listener from the listener list
|
void |
setCellValue(int i,
int j,
java.lang.Object x) |
void |
setColumnInfo(int sqlType,
java.lang.Object[] columnVals)
Set the column cell information Please use setColumnInfo(Object[] columnVals, Object[][]
vals) if array size is changed
|
void |
setColumnInfo(java.lang.Object[] columnVals,
java.lang.Object[][] vals)
Set column labels and value cells
|
void |
setRowInfo(int sqlType,
java.lang.Object[] rowVals)
Set the row cell information.
|
void |
setRowInfo(java.lang.Object[] rowVals,
java.lang.Object[][] vals)
Set row labels and value cells
|
void |
setValueInfo(int sqlType,
java.lang.Object[][] vals)
Set the value cell information
|
void |
setValueInfo(java.lang.Object[] rowVals,
java.lang.Object[] columnVals,
java.lang.Object[][] vals)
Reset the whole spread sheet
|
public SimpleSpreadSheet()
public SimpleSpreadSheet(java.lang.String[] rowVals, java.lang.String[] columnVals, java.lang.Double[][] vals)
public SimpleSpreadSheet(java.lang.String[] rowVals, java.lang.String[] columnVals, java.lang.Integer[][] vals)
public SimpleSpreadSheet(java.lang.Object[] rowVals, java.lang.Object[] columnVals, java.lang.Object[][] vals) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setRowInfo(int sqlType, java.lang.Object[] rowVals)
public void setRowInfo(java.lang.Object[] rowVals, java.lang.Object[][] vals) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setColumnInfo(int sqlType, java.lang.Object[] columnVals)
public void setColumnInfo(java.lang.Object[] columnVals, java.lang.Object[][] vals) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setValueInfo(int sqlType, java.lang.Object[][] vals)
public void setValueInfo(java.lang.Object[] rowVals, java.lang.Object[] columnVals, java.lang.Object[][] vals) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setCellValue(int i, int j, java.lang.Object x)
public int getColumnCount()
getColumnCount
in interface ISpreadSheetModel
public int getRowCount()
getRowCount
in interface ISpreadSheetModel
public int getColumnLabelType()
getColumnLabelType
in interface ISpreadSheetModel
public int getRowLabelType()
getRowLabelType
in interface ISpreadSheetModel
public int getValueType()
getValueType
in interface ISpreadSheetModel
public java.lang.Object getRowLabel(int i)
getRowLabel
in interface ISpreadSheetModel
i
- the row index (beginning at 1)public java.lang.Object getColumnLabel(int i)
getColumnLabel
in interface ISpreadSheetModel
public java.lang.Object getValueAt(int i, int j)
getValueAt
in interface ISpreadSheetModel
i
- the row index (beginning at 1)public void addSpreadSheetModelListener(ISpreadSheetModelListener l)
addSpreadSheetModelListener
in interface ISpreadSheetModel
public void removeSpreadSheetModelListener(ISpreadSheetModelListener l)
removeSpreadSheetModelListener
in interface ISpreadSheetModel
protected void fireSpreadSheetChanged(SpreadSheetModelEvent e)