|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gnu.jel.DVMap | +--uk.ac.starlink.ttools.JELRowReader
An object which is able to read cell values by column name or number.
The values are got using the evaluate(gnu.jel.CompiledExpression)
method.
This class currently deals with columns of all the primitive types,
objects of type String
or Date
,
and arrays of any of these.
Anything else is treated as an Object or Object[].
It could be extended to deal with more if necessary.
Expressions of the following types are understood:
NULL_QUERY_PREFIX
followed by a column name or
$ID identifier (see above) returns a boolean value which is
true iff the value in that column at the current row
is the null value.
Field Summary | |
static char |
COLUMN_ID_CHAR
Prefix identifying a unique column identifier. |
static String |
NULL_QUERY_PREFIX
The string which, when prefixed to a column ideentifier, indicates that the null-ness of the column should be queried. |
Constructor Summary | |
JELRowReader(StarTable table)
Constructs a new row reader for a given StarTable. |
Method Summary | |
Object |
evaluate(gnu.jel.CompiledExpression compEx)
Evaluates a given compiled expression at the current row. |
boolean[] |
getBooleanArrayProperty(int icol)
|
boolean |
getBooleanProperty(int icol)
|
boolean |
getBooleanProperty(long inul)
Indicates whether the cell at the current row in a given column has a blank value. |
byte[] |
getByteArrayProperty(int icol)
|
byte |
getByteProperty(byte ispecial)
Returns the values for byte-typed special variables. |
byte |
getByteProperty(int icol)
|
protected abstract Object |
getCell(int icol)
Returns the value for a given column in this reader's table at the current row. |
char[] |
getCharArrayProperty(int icol)
|
char |
getCharProperty(int icol)
|
abstract long |
getCurrentRow()
Returns the index of the row on which evaluations are currently taking place. |
Date[] |
getDateArrayProperty(int icol)
|
Date |
getDateProperty(int icol)
|
double[] |
getDoubleArrayProperty(int icol)
|
double |
getDoubleProperty(int icol)
|
float[] |
getFloatArrayProperty(int icol)
|
float |
getFloatProperty(int icol)
|
int[] |
getIntArrayProperty(int icol)
|
int |
getIntProperty(int icol)
|
long[] |
getLongArrayProperty(int icol)
|
long |
getLongProperty(byte ispecial)
Returns the values for long-typed special variables. |
long |
getLongProperty(int icol)
|
Object[] |
getObjectArrayProperty(int icol)
|
Object |
getObjectProperty(byte ispecial)
Returns the values for Object-typed special variables. |
Object |
getObjectProperty(int icol)
|
short[] |
getShortArrayProperty(int icol)
|
short |
getShortProperty(int icol)
|
String[] |
getStringArrayProperty(int icol)
|
String |
getStringProperty(int icol)
|
String |
getTypeName(String name)
Returns the type name of the quantity which is referenced in expressions with a given name. |
Object |
translate(String name)
Turns a value specification into a constant object which can be used at evaluation time to reference a particular quantity to evaluate. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String NULL_QUERY_PREFIX
public static final char COLUMN_ID_CHAR
Constructor Detail |
public JELRowReader(StarTable table)
table
- the StarTable this reader will read fromMethod Detail |
protected abstract Object getCell(int icol) throws IOException
icol
- column index
IOException
public abstract long getCurrentRow()
public Object evaluate(gnu.jel.CompiledExpression compEx) throws Throwable
compEx
- compiled expression
Throwable
public String getTypeName(String name)
getTypeName
in interface gnu.jel.DVResolver
getTypeName
in class gnu.jel.DVMap
name
- the variable name
public Object translate(String name)
This method is only called at expression compilation time, not evaluation time, so it doesn't need to be particularly fast.
translate
in class gnu.jel.DVMap
name
- the name of the variable-like object to evaluate
public long getLongProperty(byte ispecial)
ispecial
- the identifier for the special
public Object getObjectProperty(byte ispecial)
ispecial
- the identifier for the special
public byte getByteProperty(byte ispecial)
ispecial
- the identifier for the special
public boolean getBooleanProperty(long inul)
inul
- column index (as a long)
public boolean getBooleanProperty(int icol)
public boolean[] getBooleanArrayProperty(int icol)
public byte getByteProperty(int icol)
public byte[] getByteArrayProperty(int icol)
public char getCharProperty(int icol)
public char[] getCharArrayProperty(int icol)
public short getShortProperty(int icol)
public short[] getShortArrayProperty(int icol)
public int getIntProperty(int icol)
public int[] getIntArrayProperty(int icol)
public long getLongProperty(int icol)
public long[] getLongArrayProperty(int icol)
public float getFloatProperty(int icol)
public float[] getFloatArrayProperty(int icol)
public double getDoubleProperty(int icol)
public double[] getDoubleArrayProperty(int icol)
public String getStringProperty(int icol)
public String[] getStringArrayProperty(int icol)
public Date getDateProperty(int icol)
public Date[] getDateArrayProperty(int icol)
public Object getObjectProperty(int icol)
public Object[] getObjectArrayProperty(int icol)
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |