|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.objectplanet.gui.TableData
This class contains the data for the table component. The data is
organized into rows and colums where one row and column intersection
is a table cell.
Rows can be accessed through their index or a key that was specified
when the row was added to the data.
This table data can be shared among several table components so they
can effectively use the same data set.
All indices to rows and columns are zero based.
Field Summary | |
protected java.util.Vector |
data
The data of the table. |
Constructor Summary | |
TableData(int columns)
Creates a new table data object with the specified number of columns. |
Method Summary | |
boolean |
containsRow(int row)
Checks if the table data contains a specified row. |
java.lang.Object |
getCell(int row,
int col)
Gets the specified cell from the table. |
int |
getColumnCount()
Returns the number of columns in the Ftable data. |
int |
getLastIndex()
Returns the greates index of the rows. |
java.lang.Object[] |
getRow(int row)
Gets the fields of the specified row. |
int |
getRowCount()
Returns the number of rows in the table data. |
int |
getRowIndex(java.lang.Object key)
Translates a row key to the index it is stored in. |
boolean |
hasChangedSince(long time)
Checks if the table data has been changed since the specified time. |
void |
removeAll()
Removes all the rows from the table data. |
void |
removeRow(int index)
Removes the specified row from the table data. |
void |
setCell(int row,
int col,
java.lang.Object value)
Sets the value of a cell in the table. |
int |
setRow(int row,
java.lang.Object[] fields)
Sets a row in the table at the specified row index. |
int |
setRow(int index,
java.lang.Object key,
java.lang.Object[] fields)
Sets a row in the table at the specified row index keyed by the given key object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector data
Constructor Detail |
public TableData(int columns)
columns
- The number of columns to use for the data.Method Detail |
public boolean containsRow(int row)
row
- The row index to test for.
public java.lang.Object getCell(int row, int col)
row
- The index of the row.col
- The index of the column.
setCell(int, int, java.lang.Object)
public int getColumnCount()
public int getLastIndex()
public java.lang.Object[] getRow(int row)
row
- The row index.
java.lang.ClassCastException
- If the fields is not a String[] array.setRow(int, Object[])
public int getRowCount()
public int getRowIndex(java.lang.Object key)
key
- The key of the row.
public boolean hasChangedSince(long time)
time
- The system time to check for.public void removeAll()
public void removeRow(int index)
index
- The index of the row.public void setCell(int row, int col, java.lang.Object value)
row
- The index of the row to set the cell in.col
- The column to set the cell in.value
- The value to set for the cell (String).
java.lang.IllegalArgumentException
- If the row or column is incorrect.
java.lang.ClassCastException
- If the value is not a String.public int setRow(int row, java.lang.Object[] fields)
row
- The index of the row. -1 adds the row at the end.fields
- An array of strings.
public int setRow(int index, java.lang.Object key, java.lang.Object[] fields)
index
- The index of the row. -1 adds the row at the end.key
- The key of the row.fields
- The text for each field of the row.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |