Package uk.ac.starlink.ttools.jel
Class FixedConstant
- java.lang.Object
-
- uk.ac.starlink.ttools.jel.FixedConstant
-
-
Constructor Summary
Constructors Constructor Description FixedConstant(java.lang.Object value)
Constructs a constant with a given value.FixedConstant(java.lang.Object value, java.lang.Class<?> clazz)
Constructs a constant with a given value and class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
getContentClass()
Returns a class of which this object's value will be an instance.java.lang.Object
getValue()
Returns this object's value.boolean
requiresRowIndex()
Indicates whether evaluation of this constant needs to know the row index.
-
-
-
Constructor Detail
-
FixedConstant
public FixedConstant(java.lang.Object value, java.lang.Class<?> clazz)
Constructs a constant with a given value and class.- Parameters:
clazz
- content classvalue
- value
-
FixedConstant
public FixedConstant(java.lang.Object value)
Constructs a constant with a given value. The class is the class ofvalue
.- Parameters:
value
- value
-
-
Method Detail
-
getContentClass
public java.lang.Class<?> getContentClass()
Description copied from interface:Constant
Returns a class of which this object's value will be an instance.- Specified by:
getContentClass
in interfaceConstant
- Returns:
- content class
-
getValue
public java.lang.Object getValue()
Description copied from interface:Constant
Returns this object's value. Not necessarily always the same. Must be an instance ofConstant.getContentClass()
(or null).
-
requiresRowIndex
public boolean requiresRowIndex()
Description copied from interface:Constant
Indicates whether evaluation of this constant needs to know the row index. If executingConstant.getValue()
may result in a call toStarTableJELRowReader.getCurrentRow()
, this method must return true.- Specified by:
requiresRowIndex
in interfaceConstant
- Returns:
- true if evaluating this constant needs or may need to know the current row index
-
-