View Javadoc

1   /*$Id: ConstantColumnWrapperTable.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  /*** create a column containing a constant value in each cell.
17   * @author Noel Winstanley nw@jb.man.ac.uk 07-Dec-2004
18   *
19   */
20  class ConstantColumnWrapperTable extends AbstractColumnWrapperTable
21          implements ScriptStarTable {
22  
23      /*** Construct a new ConstantColumnWrapperTable
24       * @param meta metadata for this column
25       * @param val constant value for this column
26       * @param original original table.
27       */
28      public ConstantColumnWrapperTable(ColumnInfo meta, Object val,StarTable original) {
29          super(meta, original);
30          this.val = val;
31      }
32      protected final Object val;
33  
34      /***
35       * @see org.astrogrid.scripting.table.AbstractColumnWrapperTable#computeValue(java.lang.Object[])
36       */
37      protected Object computeValue(Object[] row) {
38          return val;
39      }
40  
41  }
42  
43  
44  /* 
45  $Log: ConstantColumnWrapperTable.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  */