1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.scripting.table;
12
13 import java.io.IOException;
14 import java.util.Iterator;
15
16 import uk.ac.starlink.table.ColumnInfo;
17 import uk.ac.starlink.table.StarTable;
18 import uk.ac.starlink.table.WrapperStarTable;
19
20 /*** wrap an existing StarTable to make it a script star table.
21 * uses the multiple-inheritance trick to reuse the definition of the extra methods.
22 * @author Noel Winstanley nw@jb.man.ac.uk 07-Dec-2004
23 *
24 */
25 class WrapperScriptStarTable extends WrapperStarTable implements
26 ScriptStarTable {
27
28 /*** Construct a new WrapperScriptStarTable
29 * @param arg0
30 */
31 public WrapperScriptStarTable(StarTable arg0) {
32 super(arg0);
33 }
34
35 protected final ExtraTableMethods methods = new ExtraTableMethodsImpl() {
36
37 protected StarTable getTable() {
38 return WrapperScriptStarTable.this;
39 }
40 };
41
42 public ScriptStarTable addColumn(ColumnInfo meta, Object colValue) {
43 return this.methods.addColumn(meta, colValue);
44 }
45 public MutableScriptStarTable asMutableTable() throws IOException {
46 return this.methods.asMutableTable();
47 }
48 public Iterator columnIterator(int col) throws IOException {
49 return this.methods.columnIterator(col);
50 }
51 public Iterator iterator() throws IOException {
52 return this.methods.iterator();
53 }
54 public ScriptStarTable removeColumn(int index) {
55 return this.methods.removeColumn(index);
56 }
57 }
58
59
60
61
62
63
64
65
66
67
68