|
|||||||||
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.CalcStarTable<C>
C
- type of object that is calculated from each row of the
input table, and supplies values to the corresponding
row of this tablepublic abstract class CalcStarTable<C>
StarTable implementation whose column values are derived from some single calculation on the column values of another table. The idea is that the cell values in a given row of an instance of this table are cheaply-obtained members of an object which is obtained by a potentially expensive calculation on the cell values of the corresponding row in the other table.
Nested Class Summary | |
---|---|
static interface |
CalcStarTable.Col<C,T>
Defines a column for use with this table implementation. |
Constructor Summary | |
---|---|
CalcStarTable(StarTable base,
CalcStarTable.Col<C,?>[] columns)
Constructor. |
Method Summary | |
---|---|
abstract C |
createCalculation(long irow)
Creates the calculation object for the given row of the input table. |
abstract C |
createCalculation(RowSequence baseSeq)
Creates the calculation object for the current row of the input table. |
StarTable |
getBaseTable()
Returns the input table on which this table is based. |
java.lang.Object |
getCell(long irow,
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. |
ColumnInfo |
getColumnInfo(int icol)
Returns the object describing the data in a given column. |
java.lang.Object[] |
getRow(long irow)
The AbstractStarTable implementation of this method constructs a row by repeated invocation of AbstractStarTable.getCell(long, int) . |
long |
getRowCount()
Returns the number of rows in this table, if known. |
RowSequence |
getRowSequence()
Returns an object which can iterate over all the rows in the table sequentially. |
boolean |
isRandom()
The AbstractStarTable implementation of this method returns false. |
Methods inherited from class uk.ac.starlink.table.AbstractStarTable |
---|
checkedLongToInt, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getURL, setName, setParameter, setParameters, setURL |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CalcStarTable(StarTable base, CalcStarTable.Col<C,?>[] columns)
base
- input tablecolumns
- array defining the columns of this tableMethod Detail |
---|
public abstract C createCalculation(RowSequence baseSeq) throws java.io.IOException
baseSeq
- row sequence of base table
positioned at row of interest
baseSeq
current row
java.io.IOException
public abstract C createCalculation(long irow) throws java.io.IOException
irow
- row index for which calculation is required
irow
java.io.IOException
public StarTable getBaseTable()
public ColumnInfo getColumnInfo(int icol)
StarTable
getColumnInfo
in interface StarTable
getColumnInfo
in class AbstractStarTable
icol
- the column for which header information is required
public int getColumnCount()
StarTable
getColumnCount
in interface StarTable
getColumnCount
in class AbstractStarTable
public long getRowCount()
StarTable
getRowCount
in interface StarTable
getRowCount
in class AbstractStarTable
public boolean isRandom()
AbstractStarTable
isRandom
in interface StarTable
isRandom
in class AbstractStarTable
public RowSequence getRowSequence() throws java.io.IOException
StarTable
getRowSequence
in interface StarTable
getRowSequence
in class AbstractStarTable
java.io.IOException
- if there is an error providing accesspublic java.lang.Object[] getRow(long irow) throws java.io.IOException
AbstractStarTable
AbstractStarTable.getCell(long, int)
.
getRow
in interface StarTable
getRow
in class AbstractStarTable
irow
- the index of the row to retrieve
java.io.IOException
- if there is an error reading the datapublic java.lang.Object getCell(long irow, int icol) throws java.io.IOException
AbstractStarTable
getCell
in interface StarTable
getCell
in class AbstractStarTable
irow
- 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |