public class ColumnIdentifier extends Object
JELRowReader
)
and where requested cases simple wildcarding expressions.Constructor and Description |
---|
ColumnIdentifier(StarTable table)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public ColumnIdentifier(StarTable table)
table
- table whose columns this identifier can identifypublic void setCaseSensitive(boolean caseSensitive)
caseSensitive
- is matching case sensitive?public boolean isCaseSensitive()
public int getColumnIndex(String colid) throws IOException
IOException
is thrown.colid
- identifying stringIOException
- 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,
each of which must be one of:
colidList
- string containing a representation of a list
of columnsIOException
- 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 columnsIOException
- 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 sensitiveglob
is trivialCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.