uk.ac.starlink.ttools.filter
Class AddJELColumnTable

java.lang.Object
  extended by uk.ac.starlink.table.WrapperStarTable
      extended by uk.ac.starlink.ttools.filter.AddJELColumnTable
All Implemented Interfaces:
uk.ac.starlink.table.StarTable

public class AddJELColumnTable
extends uk.ac.starlink.table.WrapperStarTable

Wrapper table which adds one or more columns, defined by JEL expressions.

Since:
3 Mar 2005
Author:
Mark Taylor (Starlink)

Field Summary
 
Fields inherited from class uk.ac.starlink.table.WrapperStarTable
baseTable
 
Constructor Summary
AddJELColumnTable(uk.ac.starlink.table.StarTable baseTable, uk.ac.starlink.table.ColumnInfo[] cinfos, String[] exprs, int ipos)
          Constructs a table which adds a list of new columns.
AddJELColumnTable(uk.ac.starlink.table.StarTable baseTable, uk.ac.starlink.table.ColumnInfo cinfo, String expr, int ipos)
          Constructs a table which adds a single new column at a given column index.
 
Method Summary
 Object getCell(long irow, int icol)
           
 int getColumnCount()
           
 uk.ac.starlink.table.ColumnInfo getColumnInfo(int icol)
           
 Object[] getRow(long irow)
           
 uk.ac.starlink.table.RowSequence getRowSequence()
           
 
Methods inherited from class uk.ac.starlink.table.WrapperStarTable
checkedLongToInt, getBaseTable, getColumnAuxDataInfos, getName, getParameterByName, getParameters, getRowCount, getURL, isRandom, setName, setParameter, setURL, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddJELColumnTable

public AddJELColumnTable(uk.ac.starlink.table.StarTable baseTable,
                         uk.ac.starlink.table.ColumnInfo cinfo,
                         String expr,
                         int ipos)
                  throws gnu.jel.CompilationException
Constructs a table which adds a single new column at a given column index.

Parameters:
baseTable - table on which this one is based
cinfo - ColumnInfo describing the column to be added. Only the name has to be set; other metadata items will be used if available except the contentClass, which is determined from the return type of the compiled expression
expr - JEL expression defining the value of the new column
ipos - position of the new column
Throws:
gnu.jel.CompilationException

AddJELColumnTable

public AddJELColumnTable(uk.ac.starlink.table.StarTable baseTable,
                         uk.ac.starlink.table.ColumnInfo[] cinfos,
                         String[] exprs,
                         int ipos)
                  throws gnu.jel.CompilationException
Constructs a table which adds a list of new columns.

Parameters:
baseTable - table on which this one is based
cinfos - array of ColumnInfos describing the new columns to be added. Only the names have to be set; other metadata items will be used if available apart from the contentClass, which is determined from the return type of the compiled expression
exprs - JEL expressions defining the value of the new columns
ipos - column index of the first new column; the others will follow straight after it
Throws:
gnu.jel.CompilationException
Method Detail

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface uk.ac.starlink.table.StarTable
Overrides:
getColumnCount in class uk.ac.starlink.table.WrapperStarTable

getColumnInfo

public uk.ac.starlink.table.ColumnInfo getColumnInfo(int icol)
Specified by:
getColumnInfo in interface uk.ac.starlink.table.StarTable
Overrides:
getColumnInfo in class uk.ac.starlink.table.WrapperStarTable

getCell

public Object getCell(long irow,
                      int icol)
               throws IOException
Specified by:
getCell in interface uk.ac.starlink.table.StarTable
Overrides:
getCell in class uk.ac.starlink.table.WrapperStarTable
Throws:
IOException

getRow

public Object[] getRow(long irow)
                throws IOException
Specified by:
getRow in interface uk.ac.starlink.table.StarTable
Overrides:
getRow in class uk.ac.starlink.table.WrapperStarTable
Throws:
IOException

getRowSequence

public uk.ac.starlink.table.RowSequence getRowSequence()
                                                throws IOException
Specified by:
getRowSequence in interface uk.ac.starlink.table.StarTable
Overrides:
getRowSequence in class uk.ac.starlink.table.WrapperStarTable
Throws:
IOException


Copyright © 2009 Central Laboratory of the Research Councils. All Rights Reserved.