|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.jel.DVMap
uk.ac.starlink.ttools.jel.JELRowReader
uk.ac.starlink.ttools.jel.StarTableJELRowReader
public abstract class StarTableJELRowReader
JELRowReader subclass for access to StarTables.
In addition to the syntax provided by the superclass, the following symbols are understood:
PARAM_PREFIX
followed by the name of a table
parameter (case-insensitive) is a constant for the table
(as a primitive, if applicable). This can only work
if the parameter name is a legal java identifier.
UCD_PREFIX
followed by the text of a UCD
giving the required value. Any punctuation (such as ".", ";", "-")
in the UCD should be replaced with a "_" (since these symbols cannot
appear in identifiers). If the identifier has a trailing "_",
then any UCD which starts as specified is considered to match.
The first matching column, or if there is none the first matching
parameter value is returned. UCD matching is case-insensitive.
UTYPE_PREFIX
followed by the text of a Utype
identifying the required value. Any punctuation (such as ".", ":", "-")
in the Utype should be replaced with a "_" (since these symbols cannot
appear in identifiers).
The first matching column, or if there is none the first matching
parameter value is returned. UType matching is case-insensitive.
0<=x<1
which is constant for a given row
within this reader. The quality of the random numbers may not
be particularly good.
Field Summary | |
---|---|
static String |
PARAM_PREFIX
The string which should be prefixed to a table parameter (constant) name to result in substituting its value. |
static String |
UCD_PREFIX
A string to prefix to a UCD string to indicate the column/parameter with that UCD. |
static String |
UTYPE_PREFIX
A string to prefix to a Utype string to indicate the column/parameter with that Utype. |
Fields inherited from class uk.ac.starlink.ttools.jel.JELRowReader |
---|
COLUMN_ID_CHAR, NULL_QUERY_PREFIX |
Constructor Summary | |
---|---|
StarTableJELRowReader(uk.ac.starlink.table.StarTable table)
Constructs a new row reader for a given StarTable. |
Method Summary | |
---|---|
protected boolean |
getBooleanColumnValue(int icol)
Returns a boolean value for a cell of the current row. |
protected byte |
getByteColumnValue(int icol)
Returns a byte value for a cell of the current row. |
protected abstract Object |
getCell(int icol)
Returns the value for a given column in this reader's table at the current row. |
protected char |
getCharColumnValue(int icol)
Returns a char value for a cell of the current row. |
protected Class |
getColumnClass(int icol)
Returns the class of values returned by a given column. |
protected int |
getColumnIndexByName(String name)
Returns the column index of a column in the row given its name. |
protected Constant |
getConstantByName(String name)
Understands table parameters identified case-insensitively by name (using the PARAM_PREFIX prefix) or
by UCD (using the UCD_PREFIX prefix) or
by Utype (using the UTYPE_PREFIX prefix). |
abstract long |
getCurrentRow()
Returns the index of the row on which evaluations are currently taking place. |
protected double |
getDoubleColumnValue(int icol)
Returns a double value for a cell of the current row. |
protected float |
getFloatColumnValue(int icol)
Returns a float value for a cell of the current row. |
protected int |
getIntColumnValue(int icol)
Returns a int value for a cell of the current row. |
protected long |
getLongColumnValue(int icol)
Returns a long value for a cell of the current row. |
protected Object |
getObjectColumnValue(int icol)
Returns an Object value for a cell of the current row. |
protected short |
getShortColumnValue(int icol)
Returns a short value for a cell of the current row. |
protected Constant |
getSpecialByName(String name)
Adds to the superclass implementation the following: "$0" or "index" returns INDEX_ID, which refers to the (1-based) row number "RANDOM" returns a double random number, always the same for a given row |
uk.ac.starlink.table.StarTable |
getTable()
Returns the table associated with this reader. |
static Pattern |
getUcdRegex(String ucd)
Takes a (non-prefixed) UCD specification and returns a Pattern actual UCDs should match if they represent the same thing. |
static Pattern |
getUtypeRegex(String utype)
Takes a (non-prefixed) Utype specification and returns a Pattern actual Utypes should match if they represent the same thing. |
protected boolean |
isBlank(int icol)
Indicates whether the value in a given column is null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PARAM_PREFIX
public static final String UCD_PREFIX
public static final String UTYPE_PREFIX
Constructor Detail |
---|
public StarTableJELRowReader(uk.ac.starlink.table.StarTable table)
table
- the StarTable this reader will read fromMethod Detail |
---|
public uk.ac.starlink.table.StarTable getTable()
protected abstract Object getCell(int icol) throws IOException
icol
- column index
IOException
public abstract long getCurrentRow()
protected boolean isBlank(int icol)
JELRowReader
isBlank
in class JELRowReader
icol
- column index
protected Class getColumnClass(int icol)
JELRowReader
getColumnClass
in class JELRowReader
icol
- column index
protected int getColumnIndexByName(String name)
JELRowReader
name
does not refer to any known column, return -1.
getColumnIndexByName
in class JELRowReader
name
- column name
protected Constant getConstantByName(String name)
PARAM_PREFIX
prefix) or
by UCD (using the UCD_PREFIX
prefix) or
by Utype (using the UTYPE_PREFIX
prefix).
getConstantByName
in class JELRowReader
name
- constant name
protected Constant getSpecialByName(String name)
getSpecialByName
in class JELRowReader
name
- special name
protected boolean getBooleanColumnValue(int icol)
JELRowReader
JELRowReader.foundNull()
(and return any value) if the result
is null.
getBooleanColumnValue
in class JELRowReader
icol
- column index
protected byte getByteColumnValue(int icol)
JELRowReader
JELRowReader.foundNull()
(and return any value) if the result
is null.
getByteColumnValue
in class JELRowReader
icol
- column index
protected char getCharColumnValue(int icol)
JELRowReader
JELRowReader.foundNull()
(and return any value) if the result
is null.
getCharColumnValue
in class JELRowReader
icol
- column index
protected short getShortColumnValue(int icol)
JELRowReader
JELRowReader.foundNull()
(and return any value) if the result
is null.
getShortColumnValue
in class JELRowReader
icol
- column index
protected int getIntColumnValue(int icol)
JELRowReader
JELRowReader.foundNull()
(and return any value) if the result
is null.
getIntColumnValue
in class JELRowReader
icol
- column index
protected long getLongColumnValue(int icol)
JELRowReader
JELRowReader.foundNull()
(and return any value) if the result
is null.
getLongColumnValue
in class JELRowReader
icol
- column index
protected float getFloatColumnValue(int icol)
JELRowReader
JELRowReader.foundNull()
(and return any value) if the result
is null.
getFloatColumnValue
in class JELRowReader
icol
- column index
protected double getDoubleColumnValue(int icol)
JELRowReader
JELRowReader.foundNull()
(and return any value) if the result
is null.
getDoubleColumnValue
in class JELRowReader
icol
- column index
protected Object getObjectColumnValue(int icol)
JELRowReader
getObjectColumnValue
in class JELRowReader
icol
- column index
public static Pattern getUcdRegex(String ucd)
ucd
it is considered as a trailing match-all wildcard.
ucd
- UCD1 or UCD1+ specification/pattern
public static Pattern getUtypeRegex(String utype)
utype
- utype specification
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |