|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.util.Table | +--sdsu.util.LabeledTable
This class is a two dimensional table that permits indexing via labels. Labels are taken from
the first row and column. If the contents of LabeledTable example is:
Name | Pay | Department |
Joe | $100.00 | Math |
Sally | $500.00 | Physics |
SimpleTokenizer
,
Stringizer
,
TokenCharacters
,
Table
, Serialized FormConstructor Summary | |
LabeledTable()
Create a new LabeledTable with no rows and no columns |
|
LabeledTable(int initNumberOfRows,
int initNumberOfColumns)
Create a new LabeledTable with given number of rows and columns. |
|
LabeledTable(Table contents)
Create a LabeledTable from a table |
Method Summary | |
java.lang.Object |
clone()
Clones this labledTable. |
LabeledTable |
columnAt(java.lang.Object columnLabel)
Returns the column in the table indicated by the label Returns null if column label is not found Rows labels of current labeledTable are copied to new LabeledTable |
Table |
columnsAt(int startColumn,
int endColumn)
Creates a new labeledTable with the specified columns of current labeledTable Rows labels of current labeledTable are copied to new LabeledTable |
LabeledTable |
columnsAt(java.lang.Object key,
java.lang.Object rowLabel)
Creates a new LabeledTable containing all the columns that have the value key in the indicated row. |
java.lang.Object |
elementAt(int row,
java.lang.Object columnLabel)
Returns the object in table at given row and column. |
java.lang.Object |
elementAt(java.lang.Object rowLabel,
int column)
Returns the object in table at given row and column. |
java.lang.Object |
elementAt(java.lang.Object rowLabel,
java.lang.Object columnLabel)
Returns the object in table at given row and column. |
void |
insertColumnsAt(Table newColumns,
java.lang.Object startColumnLabel)
Insert table "newColumns" in the Table. |
void |
insertRowsAt(Table newRows,
java.lang.Object rowLabel)
Insert table "newRows" in the Table. |
void |
removeColumnAt(java.lang.Object columnLabel)
Removes the indicated column from the table |
void |
removeColumnsAt(java.lang.Object key,
java.lang.Object rowLabel)
Removes the indicated columns that have key in the indicated row |
void |
removeRowAt(java.lang.Object rowLabel)
Removes the indicated row from the table |
void |
removeRowsAt(java.lang.Object key,
java.lang.Object columnLabel)
Removes the indicated rows that have key in the indicated column |
LabeledTable |
rowAt(java.lang.Object rowLabel)
Returns the column in the table indicated by the label Returns null if column label is not found |
Table |
rowsAt(int startRow,
int endRow)
Creates a new table with the specified rows of current table |
LabeledTable |
rowsAt(java.lang.Object key,
java.lang.Object columnLabel)
Returns a new table containing all the rows that have the value key in the indicated column |
void |
setElementAt(java.lang.Object data,
int row,
java.lang.Object columnLabel)
Places the object in table at given row and column |
void |
setElementAt(java.lang.Object data,
java.lang.Object rowLabel,
int column)
Places the object in table at given row and column |
void |
setElementAt(java.lang.Object data,
java.lang.Object rowLabel,
java.lang.Object columnLabel)
Places the object in table at given row and column |
Methods inherited from class sdsu.util.Table |
addColumn,
addColumns,
addRow,
addRows,
columnAt,
columnsAt,
contains,
elementAt,
elements,
fromColumnVector,
fromRowVector,
fromString,
getMetaData,
indexOf,
insertColumnsAt,
insertRowsAt,
load,
load,
numberOfColumns,
numberOfRows,
removeColumnAt,
removeColumnsAt,
removeColumnsAt,
removeRowAt,
removeRowsAt,
removeRowsAt,
rowAt,
rowsAt,
save,
setColumnSeparatorChar,
setElementAt,
setMetaData,
setRowSeparatorChar,
setTokenCharacters,
size,
toString,
toString |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public LabeledTable()
public LabeledTable(int initNumberOfRows, int initNumberOfColumns)
public LabeledTable(Table contents)
Method Detail |
public java.lang.Object clone()
public java.lang.Object elementAt(int row, java.lang.Object columnLabel) throws java.lang.ArrayIndexOutOfBoundsException
public java.lang.Object elementAt(java.lang.Object rowLabel, java.lang.Object columnLabel) throws java.lang.ArrayIndexOutOfBoundsException
public java.lang.Object elementAt(java.lang.Object rowLabel, int column) throws java.lang.ArrayIndexOutOfBoundsException
public LabeledTable columnAt(java.lang.Object columnLabel) throws java.lang.ArrayIndexOutOfBoundsException
public LabeledTable columnsAt(java.lang.Object key, java.lang.Object rowLabel) throws java.lang.ArrayIndexOutOfBoundsException
public Table columnsAt(int startColumn, int endColumn) throws java.lang.ArrayIndexOutOfBoundsException
public void insertColumnsAt(Table newColumns, java.lang.Object startColumnLabel) throws java.lang.ArrayIndexOutOfBoundsException
public void removeColumnAt(java.lang.Object columnLabel) throws java.lang.ArrayIndexOutOfBoundsException
public void removeColumnsAt(java.lang.Object key, java.lang.Object rowLabel) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.NullPointerException
key
- the key to be searched forrow
- row in table to search for the keypublic void insertRowsAt(Table newRows, java.lang.Object rowLabel) throws java.lang.ArrayIndexOutOfBoundsException
public void removeRowAt(java.lang.Object rowLabel) throws java.lang.ArrayIndexOutOfBoundsException
public void removeRowsAt(java.lang.Object key, java.lang.Object columnLabel) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.NullPointerException
key
- the key to be searched forcolumn
- column in table to search for the keypublic LabeledTable rowAt(java.lang.Object rowLabel) throws java.lang.ArrayIndexOutOfBoundsException
public Table rowsAt(int startRow, int endRow) throws java.lang.ArrayIndexOutOfBoundsException
public LabeledTable rowsAt(java.lang.Object key, java.lang.Object columnLabel) throws java.lang.ArrayIndexOutOfBoundsException
public void setElementAt(java.lang.Object data, java.lang.Object rowLabel, int column) throws java.lang.ArrayIndexOutOfBoundsException
public void setElementAt(java.lang.Object data, int row, java.lang.Object columnLabel) throws java.lang.ArrayIndexOutOfBoundsException
public void setElementAt(java.lang.Object data, java.lang.Object rowLabel, java.lang.Object columnLabel) throws java.lang.ArrayIndexOutOfBoundsException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |