public class RowListStarTable extends RandomStarTable
The current implementation stores the data in a List of Object[] arrays - each list element contains the cells of one row of the table. Thus currently you can't store more than Integer.MAX_VALUE rows.
Some validation is performed when objects are inserted into the table, but it is possible to subvert this - the table itself can't guarantee that its data structures represent a legal table.
| Constructor and Description |
|---|
RowListStarTable(ColumnInfo[] colInfos)
Constructs a new RowListStarTable specifying the columns that it
will contain.
|
RowListStarTable(StarTable template)
Constructs a new RowListStarTable with its column and table metadata
copied from an existing table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(java.lang.Object[] values)
Adds a new row to the end of the table.
|
void |
clearRows()
Removes all rows from the table.
|
java.lang.Object |
getCell(long lrow,
int icol)
Implementations of this method must be safe for concurrent calls
from multiple threads.
|
int |
getColumnCount()
Returns the number of columns in this table.
|
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column.
|
java.lang.Object[] |
getRow(long lrow)
The
AbstractStarTable implementation of this method
constructs a row by repeated invocation of AbstractStarTable.getCell(long, int). |
long |
getRowCount()
Implementations must supply a non-negative return value.
|
void |
insertRow(long lrow,
java.lang.Object[] values)
Adds a new row in the middle of the table.
|
void |
removeRow(long lrow)
Removes an existing row from the table.
|
void |
setCell(long lrow,
int icol,
java.lang.Object value)
Sets the value of a given cell in the table.
|
void |
setRow(long lrow,
java.lang.Object[] values)
Sets the value of a given row in the table.
|
getRowAccess, getRowSequence, isRandomcheckedLongToInt, close, getColumnAuxDataInfos, getName, getParameters, getRowSplittable, getURL, setName, setParameters, setURLclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParameterByName, setParameterpublic RowListStarTable(ColumnInfo[] colInfos)
colInfos - array of objects defining the columns of the tablepublic RowListStarTable(StarTable template)
template
is ignored.template - template table supplying column and table metadatapublic long getRowCount()
RandomStarTablegetRowCount in interface StarTablegetRowCount in class RandomStarTablepublic int getColumnCount()
StarTablegetColumnCount in interface StarTablegetColumnCount in class AbstractStarTablepublic ColumnInfo getColumnInfo(int icol)
StarTablegetColumnInfo in interface StarTablegetColumnInfo in class AbstractStarTableicol - the column for which header information is requiredicolpublic java.lang.Object getCell(long lrow,
int icol)
RandomStarTablegetCell in interface StarTablegetCell in class RandomStarTablelrow - the index of the cell's rowicol - the index of the cell's columnpublic java.lang.Object[] getRow(long lrow)
AbstractStarTableAbstractStarTable implementation of this method
constructs a row by repeated invocation of AbstractStarTable.getCell(long, int).getRow in interface StarTablegetRow in class AbstractStarTablelrow - the index of the row to retrieveirowpublic void setCell(long lrow,
int icol,
java.lang.Object value)
value has to have a class compatible with its column.lrow - row indexicol - column indexvalue - new value for the cell at
lrow, icoljava.lang.IllegalArgumentException - if value is not
compatible with column icolpublic void setRow(long lrow,
java.lang.Object[] values)
values has to have the same number of elements as there
are columns in this table, and its elements have to have classes
compatible with the table columns.lrow - row indexvalues - new values for the cells in row lrowjava.lang.IllegalArgumentException - if values has the wrong
number of elements or they are of the wrong classpublic void addRow(java.lang.Object[] values)
values has to have the same number of elements as there
are columns in this table, and its elements have to have classes
compatible with the table columns.values - values for the cells in the new rowjava.lang.IllegalArgumentException - if values has the wrong
number of elements or they are of the wrong classpublic void insertRow(long lrow,
java.lang.Object[] values)
lrow will be shoved down by one.
values has to have the same number of elements as there
are columns in this table, and its elements have to have classes
compatible with the table columns.lrow - row index for the new rowvalues - values for the cells in the new rowjava.lang.IllegalArgumentException - if values has the wrong
number of elements or they are of the wrong classpublic void removeRow(long lrow)
lrow will be moved up by one.lrow - index of the row to removepublic void clearRows()