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
-
public abstract class RandomJELRowReader extends StarTableJELRowReader
Provides JELRowReader functionality for a random access table. This abstract class adds the abstract methodevaluateAtRow(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
Constructors Modifier Constructor Description protected
RandomJELRowReader(uk.ac.starlink.table.StarTable table)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static 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 java.lang.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, 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
-
-
-
-
Method Detail
-
evaluateAtRow
public abstract java.lang.Object evaluateAtRow(gnu.jel.CompiledExpression compEx, long lrow) throws java.lang.Throwable
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:
java.lang.Throwable
-
createConcurrentReader
public static RandomJELRowReader createConcurrentReader(uk.ac.starlink.table.StarTable table)
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 java.io.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:
java.io.IOException
-
-