|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.jel.ColumnIdentifier
public class ColumnIdentifier
Can identify columns of a table using string identifiers. Permitted identifiers are (currently) column name (case insensitive), column index (1-based), ucd$* style UCD specifiers (see JELRowReader) and where requested cases simple wildcarding expressions.
Constructor Summary | |
---|---|
ColumnIdentifier(uk.ac.starlink.table.StarTable table)
Constructor. |
Method Summary | |
---|---|
boolean[] |
getColumnFlags(String colIdList)
Returns an array of flags, the same length as the number of columns in the table, with an element set true for each column which is specified in colIdList . |
int |
getColumnIndex(String colid)
Returns the index of a column given an identifying string. |
int[] |
getColumnIndices(String colidList)
Returns an array of column indices from a <colid-list> string. |
static Pattern |
globToRegex(String glob,
boolean caseSensitive)
Turns a glob-type pattern into a regular expression Pattern. |
boolean |
isCaseSensitive()
Determines whether case is significant in column names. |
void |
setCaseSensitive(boolean caseSensitive)
Sets whether case is significant in column names. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColumnIdentifier(uk.ac.starlink.table.StarTable table)
table
- table whose columns this identifier can identifyMethod Detail |
---|
public void setCaseSensitive(boolean caseSensitive)
caseSensitive
- is matching case sensitive?public boolean isCaseSensitive()
public int getColumnIndex(String colid) throws IOException
colid
- identifying string
IOException
- if colid does not name a columnpublic int[] getColumnIndices(String colidList) throws IOException
<colid-list>
string.
The string is split up into whitespace-separated tokens,
and each element must either be the identifier of an individual
column or a non-trivial glob-like pattern which may match
zero or more columns.
colidList
- string containing a representation of a list
of columns
IOException
- if colid doesn't look like a
colid-list specifierpublic boolean[] getColumnFlags(String colIdList) throws IOException
colIdList
.
This convenience function just works on the result of
getColumnIndices(java.lang.String)
.
colIdList
- string containing a representation of a list
of columns
IOException
- if colid doesn't look like a
colid-list specifierpublic static Pattern globToRegex(String glob, boolean caseSensitive)
glob
contains no wildcards,
null
will be returned.
glob
- glob patterncaseSensitive
- whether matching should be case sensitive
glob
is trivial
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |