|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.data.tables.Table<C>
public class Table<C>
A table of Cell types.
NOT THREAD SAFE!!!
Version History
EPG - Rewrite from another project - 18 APR 04 EPG - Converted to use generics - 13 MAY 06
Constructor Summary | |
---|---|
Table()
Default constructor. |
Method Summary | |
---|---|
void |
append(C... items)
Append a row. |
C |
getCell(int row,
int column)
Get a cell at the specified index. |
java.util.ArrayList<java.lang.String> |
getHeaders()
Get the headers. |
java.lang.String[] |
getHeadersArray()
Get the headers as an array. |
int |
getNumberColumns()
Get the number of columns. |
int |
getNumberRows()
Get the number of rows. |
java.util.ArrayList<C> |
getRow(int index)
Get a row at the specified index. |
C[] |
getRowArray(int index)
Get a row at the specified index as an array. |
java.util.Iterator<java.util.ArrayList<C>> |
iterator()
Get an iterator for the rows. |
void |
putCell(int row,
int column,
C item)
Put a cell at the specified index. |
void |
setHeaders(java.lang.String... items)
Set headers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Table()
Method Detail |
---|
public int getNumberRows()
public int getNumberColumns()
public void append(C... items)
items
- Items in the row.public void setHeaders(java.lang.String... items)
items
- Names for each header.public C[] getRowArray(int index) throws ThingsException
index
- The index of the row.
ThingsException
public java.util.Iterator<java.util.ArrayList<C>> iterator()
iterator
in interface java.lang.Iterable<java.util.ArrayList<C>>
public java.util.ArrayList<C> getRow(int index) throws ThingsException
index
- The index of the row.
ThingsException
public java.util.ArrayList<java.lang.String> getHeaders() throws ThingsException
ThingsException
public java.lang.String[] getHeadersArray() throws ThingsException
ThingsException
public C getCell(int row, int column) throws ThingsException
row
- The row index starting from 0.column
- The column index starting from 0.
ThingsException
public void putCell(int row, int column, C item) throws ThingsException
row
- The row index starting from 0.column
- The column index starting from 0.item
- The item to put in the cell.
ThingsException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |