uk.ac.starlink.topcat
Class TopcatJELRowReader

java.lang.Object
  extended by gnu.jel.DVMap
      extended by uk.ac.starlink.ttools.jel.JELRowReader
          extended by uk.ac.starlink.ttools.jel.StarTableJELRowReader
              extended by uk.ac.starlink.ttools.jel.RandomJELRowReader
                  extended by uk.ac.starlink.topcat.TopcatJELRowReader

public class TopcatJELRowReader
extends uk.ac.starlink.ttools.jel.RandomJELRowReader

Random JELRowReader with which recognises some expressions in addition to those of the superclass.

Row Subset _ID identifiers:
The character '_' followed by the 1-based index of a defined row subset returns true iff the current row is part of the subset.
Row Subset names:
The name of a subset (case-insensitive) returns true iff the current row is part of the named subset.
Apparent table index:
The tokens "$index0" or "$00" (case insensitive) are evaluated as the index of the current row in the apparent table; this differs from $index/$0 if a non-default sort order or current subset is in force.
Apparent table row count:
The token "$nrow0" is the number of rows in the apparent table; this differs from $nrow if a non-default current subset is in force.
Apparent table column count:
The token "$ncol0 is the number of columns in the apparent table; this differs from $ncol if some columns are hidden.

Since:
8 Feb 2005
Author:
Mark Taylor (Starlink)

Field Summary
static char SUBSET_ID_CHAR
          Prefix identifying a unique subset identifier.
 
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
TopcatJELRowReader(TopcatModel tcModel)
          Constructs a new row reader for a TopcatModel.
 
Method Summary
protected  uk.ac.starlink.ttools.jel.Constant createDescribedValueConstant(uk.ac.starlink.table.DescribedValue dval)
          Returns a constant which is evaluated at runtime.
 boolean getBooleanProperty(short isub)
          Returns the actual subset value for the current row and a given column.
protected  uk.ac.starlink.ttools.jel.Constant getSpecialByName(String name)
           
 TopcatModel getTopcatModel()
          Returns the topcat model on which this row reader is based.
 int[] getTranslatedSubsetIds()
          Returns a set (no duplicated elements) of the subset IDs for which this RowReader has been asked to provide translation values.
 String getTypeName(String name)
          Overrides superclass implementation to recognise row subsets by name or _ID.
 Object translate(String name)
          Overrides superclass implementation to recognise subsets as well as the other special objects.
 
Methods inherited from class uk.ac.starlink.ttools.jel.RandomJELRowReader
evaluateAtRow, getCell, getCurrentRow, setCurrentRow
 
Methods inherited from class uk.ac.starlink.ttools.jel.StarTableJELRowReader
getBooleanColumnValue, getByteColumnValue, getCharColumnValue, getColumnClass, getColumnIndexByName, getConstantByName, getDoubleColumnValue, getFloatColumnValue, getIntColumnValue, getLongColumnValue, getObjectColumnValue, getShortColumnValue, getTable, getUcdRegex, getUtypeRegex, isBlank
 
Methods inherited from class uk.ac.starlink.ttools.jel.JELRowReader
evaluate, 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, setFailOnNull, stripPrefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBSET_ID_CHAR

public static final char SUBSET_ID_CHAR
Prefix identifying a unique subset identifier.

See Also:
Constant Field Values
Constructor Detail

TopcatJELRowReader

public TopcatJELRowReader(TopcatModel tcModel)
Constructs a new row reader for a TopcatModel.

Parameters:
tcModel - topcat model
Method Detail

getTopcatModel

public TopcatModel getTopcatModel()
Returns the topcat model on which this row reader is based.

Returns:
topcat model

getTypeName

public String getTypeName(String name)
Overrides superclass implementation to recognise row subsets by name or _ID.

Overrides:
getTypeName in class uk.ac.starlink.ttools.jel.JELRowReader
Parameters:
name - the variable name
Returns:
corresponding method name fragment
See Also:
"JEL manual"

translate

public Object translate(String name)
Overrides superclass implementation to recognise subsets as well as the other special objects. The additional return type is:

Overrides:
translate in class uk.ac.starlink.ttools.jel.JELRowReader
Parameters:
name - the name of the variable-like object to evaluate
Returns:
a numeric object corresponding to an object which we know how to evaluate
See Also:
"JEL manual"

getTranslatedSubsetIds

public int[] getTranslatedSubsetIds()
Returns a set (no duplicated elements) of the subset IDs for which this RowReader has been asked to provide translation values. In practice that means the ID (in the sense of the OptionsListModel returned by TopcatModel.getSubsets) of every RowSubset which has been directly referenced in a JEL expression which this RowReader has been used to compile.

Returns:
list of distinct subset IDs which this row reader has had to reference in compiling JEL expressions

getBooleanProperty

public boolean getBooleanProperty(short isub)
Returns the actual subset value for the current row and a given column.

Parameters:
isub - index of the subset to evaluate at the current row
Returns:
result of the isIncluded method of the RowSubset indicated at the current row

getSpecialByName

protected uk.ac.starlink.ttools.jel.Constant getSpecialByName(String name)
Overrides:
getSpecialByName in class uk.ac.starlink.ttools.jel.StarTableJELRowReader

createDescribedValueConstant

protected uk.ac.starlink.ttools.jel.Constant createDescribedValueConstant(uk.ac.starlink.table.DescribedValue dval)
Returns a constant which is evaluated at runtime. This is more appropriate than the inherited (evaluate at call time) behaviour, since within TOPCAT the constant's value may change as a result of user intervention during the lifetime of the returned object.

Overrides:
createDescribedValueConstant in class uk.ac.starlink.ttools.jel.StarTableJELRowReader


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.