uk.ac.starlink.ttools
Class ColumnIdentifier

java.lang.Object
  |
  +--uk.ac.starlink.ttools.ColumnIdentifier

public class ColumnIdentifier
extends Object

Can identify columns of a table using string identifiers. Permitted identifiers are (currently) column name (if in JEL-friendly format), column $ID (ditto) or column index (first column is "1").

Since:
2 Mar 2005

Constructor Summary
ColumnIdentifier(StarTable table)
          Constructor.
 
Method Summary
 int getColumnIndex(String colid)
          Returns the index of a column given an identifying string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnIdentifier

public ColumnIdentifier(StarTable table)
Constructor.

Parameters:
table - table whose columns this identifier can identify
Method Detail

getColumnIndex

public int getColumnIndex(String colid)
                   throws IOException
Returns the index of a column given an identifying string. If the string can't be identified as a column of this object's table, an IOException is thrown.

Parameters:
colid - identifying string
Returns:
column index
Throws:
IOException - if colid does not name a column

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.