|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.infoviz.datamodel.table.IVTableModel
IVTableModel is a data strucure for tabular data. It provides interfaces to manupulate the table columns, rows and cells. A Caller can attach a listener to the IVTableModel to get notified when the table changes.
$Id$ $Revision$ $Author$
| Constructor Summary | |
IVTableModel(IVTableDefinition ivTableDefinition)
creates a table from the table definition provided |
|
| Method Summary | |
void |
addColumn(IVColumnDefinition colDefn,
java.util.List rowValues)
adds a column |
void |
addListener(IVTableModelListener l)
add a listener for table change events |
void |
addRow(java.util.List rowValues)
adds a new row to the table with the values specified in the given list |
void |
addRow(java.lang.Object[] rowValues)
adds a new row with values as specified in the Object array |
java.lang.Object[] |
getColumnValues(int columnIndex)
returns the column at the specified index |
java.lang.Object[] |
getColumnValues(java.lang.String name)
returns the column with the given name |
protected IVTableDefinition |
getIVTableDefinition()
we will not let the users modify the definition once the table is created because we have no way to listen to the changed in the definition. |
protected java.util.List |
getRows()
we do not want the API users to modify this List directly, so we make this method protected. |
java.lang.Object[] |
getRowValues()
returns all the rows |
java.lang.Object |
getValueAt(int rowIndex,
int colIndex)
get value of a row, col combination |
void |
removeColumn(int columnIndex)
removes a column |
void |
removeColumn(java.lang.String columnName)
remove column with the specified name |
void |
removeRow(int rowIndex)
removes the row at the given index |
void |
removeRows(int[] rowIndices)
removes rows at the given indices |
void |
setListenersEnabled(boolean flag)
enables/disables table change notifications to listeners. |
void |
setValueAt(int rowIndex,
int colIndex,
java.lang.Object value)
sets value at a row, column combination |
void |
updateRow(int[] rowIndices,
java.util.List[] rowValues)
updates a batch of rows |
void |
updateRow(int index,
java.util.List rowValues)
updates the row |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IVTableModel(IVTableDefinition ivTableDefinition)
ivTableDefinition - | Method Detail |
protected IVTableDefinition getIVTableDefinition()
protected java.util.List getRows()
public java.lang.Object[] getRowValues()
public java.lang.Object[] getColumnValues(int columnIndex)
columnIndex - index of the column
public java.lang.Object[] getColumnValues(java.lang.String name)
name - name of the column
public java.lang.Object getValueAt(int rowIndex,
int colIndex)
rowIndex - index of rowcolIndex - index of column
public void setValueAt(int rowIndex,
int colIndex,
java.lang.Object value)
rowIndex - index of rowcolIndex - index of columnvalue - public void addRow(java.util.List rowValues)
rowValues - each element of the list is the cell value for the corresponding columnpublic void addRow(java.lang.Object[] rowValues)
rowValues - public void removeRow(int rowIndex)
rowIndex - the index of the rowpublic void removeRows(int[] rowIndices)
rowIndices -
public void updateRow(int index,
java.util.List rowValues)
index - index of the rowrowValues - new values
public void updateRow(int[] rowIndices,
java.util.List[] rowValues)
rowIndices - rowIndices of the rowsrowValues - new values
public void addColumn(IVColumnDefinition colDefn,
java.util.List rowValues)
colDefn - the column definitionrowValues - row valuespublic void removeColumn(java.lang.String columnName)
columnName - public void removeColumn(int columnIndex)
columnIndex - public void addListener(IVTableModelListener l)
l - the listenerpublic void setListenersEnabled(boolean flag)
flag -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||