View Javadoc

1   /*$Id: FunctionColumnWrapperTable.java,v 1.2 2004/12/07 16:50:33 jdt Exp $
2    * Created on 07-Dec-2004
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
9    *
10  **/
11  package org.astrogrid.scripting.table;
12  
13  import uk.ac.starlink.table.ColumnInfo;
14  import uk.ac.starlink.table.StarTable;
15  
16  /*** Define a new column using values returned by a {@link org.astrogrid.scripting.table.ColumnFunction}
17   * @author Noel Winstanley nw@jb.man.ac.uk 07-Dec-2004
18   *
19   */
20  class FunctionColumnWrapperTable extends AbstractColumnWrapperTable implements
21          ScriptStarTable {
22  
23      /*** Construct a new FunctionColumnWrapperTable
24       * @param meta
25       * @param original
26       */
27      public FunctionColumnWrapperTable(ColumnInfo meta, ColumnFunction funct,StarTable original) {
28          super(meta, original);
29          this.funct = funct;
30      }
31      protected final ColumnFunction funct;
32  
33      /***
34       * @throws Exception
35       * @see org.astrogrid.scripting.table.AbstractColumnWrapperTable#computeValue(java.lang.Object[])
36       */
37      protected Object computeValue(Object[] row) throws Exception {
38          return funct.computeValue(row);
39      }
40  
41  }
42  
43  
44  /* 
45  $Log: FunctionColumnWrapperTable.java,v $
46  Revision 1.2  2004/12/07 16:50:33  jdt
47  merges from scripting-nww-805
48  
49  Revision 1.1.2.1  2004/12/07 14:47:58  nw
50  got table manipulation working.
51   
52  */