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()
Returns the number of columns (except the row labels)
|
java.lang.Object |
getColumnLabel(int i)
Get the label for the given column
|
int |
getColumnLabelType()
Returns the data type of the column labels
|
int |
getRowCount()
Returns the number of rows
|
java.lang.Object |
getRowLabel(int i)
Get the label for the given row
|
int |
getRowLabelType()
Returns the data type of the row labels
|
java.lang.Object |
getValueAt(int i,
int j)
Get the value at a given row and column indexes (beginning at 1)
|
int |
getValueType()
Returns the data type of the values
|
void |
removeSpreadSheetModelListener(ISpreadSheetModelListener l)
Removes the given listener from the listener list
|
void |
setCellValue(int i,
int j,
java.lang.Object x)
Assign value to cell.
|
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.IllegalArgumentExceptionpublic 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.IllegalArgumentExceptionpublic 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.IllegalArgumentExceptionpublic 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.IllegalArgumentExceptionpublic void setCellValue(int i,
int j,
java.lang.Object x)
public int getColumnCount()
ISpreadSheetModelgetColumnCount in interface ISpreadSheetModelpublic int getRowCount()
ISpreadSheetModelgetRowCount in interface ISpreadSheetModelpublic int getColumnLabelType()
ISpreadSheetModelgetColumnLabelType in interface ISpreadSheetModelpublic int getRowLabelType()
ISpreadSheetModelgetRowLabelType in interface ISpreadSheetModelpublic int getValueType()
ISpreadSheetModelgetValueType in interface ISpreadSheetModelpublic java.lang.Object getRowLabel(int i)
getRowLabel in interface ISpreadSheetModeli - the row index (beginning at 1)public java.lang.Object getColumnLabel(int i)
getColumnLabel in interface ISpreadSheetModelpublic java.lang.Object getValueAt(int i,
int j)
getValueAt in interface ISpreadSheetModeli - the row index (beginning at 1)public void addSpreadSheetModelListener(ISpreadSheetModelListener l)
addSpreadSheetModelListener in interface ISpreadSheetModelpublic void removeSpreadSheetModelListener(ISpreadSheetModelListener l)
removeSpreadSheetModelListener in interface ISpreadSheetModelprotected void fireSpreadSheetChanged(SpreadSheetModelEvent e)