|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.starlink.table.AbstractStarTable
uk.ac.starlink.table.RandomStarTable
uk.ac.starlink.table.ColumnStarTable
public abstract class ColumnStarTable
A random-access StarTable that manages its data in columns.
The data in each column
is managed by a 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).
| Field Summary | |
|---|---|
java.util.List |
columns
|
| Constructor Summary | |
|---|---|
ColumnStarTable()
Default constructor. |
|
ColumnStarTable(StarTable template)
Initialises a ColumnStarTable using a template StarTable to provide per-table metadata. |
|
| Method Summary | |
|---|---|
void |
addColumn(ColumnData coldata)
Appends a new column to the end of this model. |
java.lang.Object |
getCell(long lrow,
int icol)
The AbstractStarTable implementation of this method throws an UnsupportedOperationException, since unless otherwise provided there is no random access. |
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,
java.lang.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. |
| Methods inherited from class uk.ac.starlink.table.RandomStarTable |
|---|
getRowSequence, isRandom |
| Methods inherited from class uk.ac.starlink.table.AbstractStarTable |
|---|
checkedLongToInt, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getRow, getURL, setName, setParameter, setParameters, setURL |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.util.List columns
| Constructor Detail |
|---|
public ColumnStarTable()
public ColumnStarTable(StarTable template)
template - the template StarTable| Method Detail |
|---|
public abstract long getRowCount()
getRowCount in interface StarTablegetRowCount in class RandomStarTablepublic int getColumnCount()
StarTable
getColumnCount in interface StarTablegetColumnCount in class AbstractStarTablepublic ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo in interface StarTablegetColumnInfo in class AbstractStarTableicol - the column for which header information is required
public java.lang.Object getCell(long lrow,
int icol)
throws java.io.IOException
AbstractStarTable
getCell in interface StarTablegetCell in class AbstractStarTablelrow - the index of the cell's rowicol - the index of the cell's column
java.io.IOException - if there is an error reading the data
public void setCell(long lrow,
int icol,
java.lang.Object value)
throws java.io.IOException
lrow - the row indexicol - the column indexvalue - the value to store
java.io.IOException - if an I/O error occurs
java.lang.UnsupportedOperationException - if column icol is not
writable (!getColumnData(icol).isWritable());public ColumnData getColumnData(int icol)
icol - the index of the column for which the result is required
public void addColumn(ColumnData coldata)
coldata - the new column object to add
public void setColumn(int icol,
ColumnData coldata)
icol - the column index to changecoldata - the new column data objectpublic static ColumnStarTable makeTableWithRows(long nrow)
nrow - the number of rows this table will have
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||