public abstract class ColumnStarTable extends RandomStarTable
ColumnData
object which can be accessed
directly using the getColumnData(int)
method. Columns can be
added and substituted. If the columns permit it then table cells
can be written to as well as read from.
Concrete subclasses of this abstract class must implement
getRowCount()
.
If you just need a ColumnStarTable
with a fixed number of rows
you can use the static convenience method makeTableWithRows(long)
.
Modifier and Type | Field and Description |
---|---|
List<ColumnData> |
columns_ |
Constructor and Description |
---|
ColumnStarTable()
Default constructor.
|
ColumnStarTable(StarTable template)
Initialises a
ColumnStarTable using a template
StarTable to provide per-table metadata. |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(ColumnData coldata)
Appends a new column to the end of this model.
|
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.
|
ColumnData |
getColumnData(int icol)
Returns the
ColumnData object for a given column. |
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column.
|
abstract long |
getRowCount()
Gets the number of rows in the table (which must be applicable to
all the columns).
|
static ColumnStarTable |
makeTableWithRows(long nrow)
Convenience method to return a
ColumnStarTable
with a fixed number of rows. |
void |
setCell(long lrow,
int icol,
Object value)
Stores an object in a given cell of the table.
|
void |
setColumn(int icol,
ColumnData coldata)
Substitutes a new column for the one which is currently in a given
position.
|
getRowAccess, getRowSequence, isRandom
checkedLongToInt, close, getColumnAuxDataInfos, getName, getParameters, getRow, getRowSplittable, getURL, setName, setParameters, setURL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParameterByName, setParameter
public List<ColumnData> columns_
public ColumnStarTable()
public ColumnStarTable(StarTable template)
ColumnStarTable
using a template
StarTable
to provide per-table metadata.
The newly constructed object will have
copies of the template
's name, parameters etc.template
- the template StarTablepublic abstract long getRowCount()
RandomStarTable
the
return value must be non-negative.getRowCount
in interface StarTable
getRowCount
in class RandomStarTable
public int getColumnCount()
StarTable
getColumnCount
in interface StarTable
getColumnCount
in class AbstractStarTable
public ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
getColumnInfo
in class AbstractStarTable
icol
- the column for which header information is requiredicol
public Object getCell(long lrow, int icol) throws IOException
RandomStarTable
getCell
in interface StarTable
getCell
in class RandomStarTable
lrow
- the index of the cell's rowicol
- the index of the cell's columnIOException
- if there is an error reading the datapublic void setCell(long lrow, int icol, Object value) throws IOException
lrow
- the row indexicol
- the column indexvalue
- the value to storeIOException
- if an I/O error occursUnsupportedOperationException
- if column icol
is not writable
(!getColumnData(icol).isWritable()
);public ColumnData getColumnData(int icol)
ColumnData
object for a given column.icol
- the index of the column for which the result is requiredicol
public void addColumn(ColumnData coldata)
coldata
- the new column object to addpublic void setColumn(int icol, ColumnData coldata)
icol
- the column index to changecoldata
- the new column data objectpublic static ColumnStarTable makeTableWithRows(long nrow)
ColumnStarTable
with a fixed number of rows.nrow
- the number of rows this table will haveCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.