Package uk.ac.starlink.ttools.jel
Class FixedConstant<T>
- java.lang.Object
-
- uk.ac.starlink.ttools.jel.FixedConstant<T>
-
-
Constructor Summary
Constructors Constructor Description FixedConstant(T value, java.lang.Class<T> clazz)
Constructs a constant with a given value and class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> FixedConstant<T>
createConstant(T value)
Constructs a constant with a given value.java.lang.Class<T>
getContentClass()
Returns a class of which this object's value will be an instance.T
getValue()
Returns this object's value.boolean
requiresRowIndex()
Indicates whether evaluation of this constant needs to know the row index.
-
-
-
Method Detail
-
getContentClass
public java.lang.Class<T> getContentClass()
Description copied from interface:Constant
Returns a class of which this object's value will be an instance.- Specified by:
getContentClass
in interfaceConstant<T>
- Returns:
- content class
-
getValue
public T getValue()
Description copied from interface:Constant
Returns this object's value. Not necessarily always the same.
-
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<T>
- Returns:
- true if evaluating this constant needs or may need to know the current row index
-
createConstant
public static <T> FixedConstant<T> createConstant(T value)
Constructs a constant with a given value. The constant parameterised type is the runtime type of the supplied value.- Parameters:
value
- constant value- Returns:
- new constant
-
-