|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.filter.CalculatorColumnSupplement
public abstract class CalculatorColumnSupplement
ColumnSupplement whose columns are derived by calculating values
based on all the columns of another table.
To generate any of the columns of this table, a whole row of the
input supplement must be read.
Concrete implementations of this abstract class must implement the
calculate(java.lang.Object[])
method.
Constructor Summary | |
---|---|
CalculatorColumnSupplement(ColumnSupplement baseSup,
ColumnInfo[] outColInfos)
Constructor. |
Method Summary | |
---|---|
protected abstract Object[] |
calculate(Object[] inRow)
Performs the calculations which populate the columns of this table. |
SupplementSequence |
createSequence(RowSequence rseq)
Returns a new iterator over the values in the columns defined by this object. |
Object |
getCell(long irow,
int icol)
Random access read of a cell defined by this object. |
int |
getColumnCount()
Returns the number of columns defined by this object. |
ColumnInfo |
getColumnInfo(int icol)
Returns the column metadata object for a given column. |
static double |
getDouble(Object value)
Utility method to turn an Object into a floating point value. |
Object[] |
getRow(long irow)
Random access read of a row defined by this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CalculatorColumnSupplement(ColumnSupplement baseSup, ColumnInfo[] outColInfos)
baseSup
- base supplementoutColInfos
- column metadata for the supplementary columns
(length defines column count)Method Detail |
---|
protected abstract Object[] calculate(Object[] inRow) throws IOException
The implementation must return a new array each time,
not repopulate the same Object[]
array object.
inRow
- input column values
IOException
public int getColumnCount()
ColumnSupplement
getColumnCount
in interface ColumnSupplement
public ColumnInfo getColumnInfo(int icol)
ColumnSupplement
getColumnInfo
in interface ColumnSupplement
icol
- column index within this object
public Object[] getRow(long irow) throws IOException
ColumnSupplement
getRow
in interface ColumnSupplement
irow
- row index
IOException
public Object getCell(long irow, int icol) throws IOException
ColumnSupplement
getCell
in interface ColumnSupplement
irow
- row indexicol
- column index
IOException
public SupplementSequence createSequence(RowSequence rseq) throws IOException
ColumnSupplement
createSequence
in interface ColumnSupplement
rseq
- row sequence providing data from the host table
IOException
public static double getDouble(Object value)
value
- object value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |