Package uk.ac.starlink.ttools.jel
Class RandomJELRowReader
java.lang.Object
gnu.jel.DVMap
uk.ac.starlink.ttools.jel.JELRowReader
uk.ac.starlink.ttools.jel.StarTableJELRowReader
uk.ac.starlink.ttools.jel.RandomJELRowReader
Provides JELRowReader functionality for a random access table.
This abstract class adds the abstract method
evaluateAtRow(gnu.jel.CompiledExpression, long)
;
factory methods are provided to implement this in different ways
according to the requirements of multi-threaded usage.- Since:
- 8 Feb 2005
- Author:
- Mark Taylor (Starlink)
-
Field Summary
Fields inherited from class uk.ac.starlink.ttools.jel.StarTableJELRowReader
PARAM_PREFIX, UCD_PREFIX, UTYPE_PREFIX
Fields inherited from class uk.ac.starlink.ttools.jel.JELRowReader
COLUMN_ID_CHAR, NULL_QUERY_PREFIX, OBJECT_PREFIX
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RandomJELRowReader
(uk.ac.starlink.table.StarTable table) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic RandomJELRowReader
createAccessReader
(uk.ac.starlink.table.StarTable table) Convenience method that obtains and uses a RowAccess from a given table.static RandomJELRowReader
createAccessReader
(uk.ac.starlink.table.StarTable table, uk.ac.starlink.table.RowAccess racc) Returns an instance that uses a RowAccess object from the table for supplying data values.static RandomJELRowReader
createConcurrentReader
(uk.ac.starlink.table.StarTable table) Returns an instance that uses the threadsafe random access methods of the supplied table.abstract Object
evaluateAtRow
(gnu.jel.CompiledExpression compEx, long lrow) Evaluates a given compiled expression at a given row.Methods inherited from class uk.ac.starlink.ttools.jel.StarTableJELRowReader
createDescribedValueConstant, getBooleanColumnValue, getByteColumnValue, getCell, getCharColumnValue, getColumnClass, getColumnIndexByName, getConstantByName, getCurrentRow, getDescribedValueByName, getDoubleColumnValue, getFloatColumnValue, getIntColumnValue, getLongColumnValue, getObjectColumnValue, getShortColumnValue, getSpecialByName, getTable, getUcdRegex, getUtypeRegex, isBlank, requiresRowIndex, valueDouble, valueInt, valueLong, valueObject, valueString
Methods inherited from class uk.ac.starlink.ttools.jel.JELRowReader
evaluate, evaluateBoolean, evaluateDouble, foundNull, getBooleanArrayProperty, getBooleanProperty, getBooleanProperty, getBooleanValue, getByteArrayProperty, getByteProperty, getByteValue, getCharArrayProperty, getCharProperty, getCharValue, getColumnIndex, getDateArrayProperty, getDoubleArrayProperty, getDoubleProperty, getDoubleValue, getFloatArrayProperty, getFloatProperty, getFloatValue, getIntArrayProperty, getIntProperty, getIntValue, getLongArrayProperty, getLongProperty, getLongValue, getNumberProperty, getObjectArrayProperty, getObjectProperty, getShortArrayProperty, getShortProperty, getShortValue, getStringArrayProperty, getStringProperty, getTranslatedColumns, getTranslatedConstants, getTypeName, setFailOnNull, stripPrefix, translate
-
Constructor Details
-
RandomJELRowReader
protected RandomJELRowReader(uk.ac.starlink.table.StarTable table) Constructor.- Parameters:
table
- table object
-
-
Method Details
-
evaluateAtRow
Evaluates a given compiled expression at a given row. The returned value is wrapped up as an object if the result of the expression is a primitive.- Parameters:
compEx
- compiled expressionlrow
- row index- Returns:
- expression result as an object
- Throws:
Throwable
-
createConcurrentReader
Returns an instance that uses the threadsafe random access methods of the supplied table. The random access methods of the returned object are synchronized, so that although it is safe for use from multiple threads, it may not be efficient.- Parameters:
table
- supplies data- Returns:
- row reader
-
createAccessReader
public static RandomJELRowReader createAccessReader(uk.ac.starlink.table.StarTable table, uk.ac.starlink.table.RowAccess racc) Returns an instance that uses a RowAccess object from the table for supplying data values. This is only suitable for use from a single thread.- Parameters:
table
- table objectracc
- row access previously obtained from table- Returns:
- row reader
-
createAccessReader
public static RandomJELRowReader createAccessReader(uk.ac.starlink.table.StarTable table) throws IOException Convenience method that obtains and uses a RowAccess from a given table. Note it is not possible to close the RowAccess in this case.- Parameters:
table
- table object- Returns:
- result of
createAccessReader(table,table.getRowAccess())
- Throws:
IOException
-