Package uk.ac.starlink.ttools.plot2.geom
Class TimeJELFunction
java.lang.Object
uk.ac.starlink.ttools.plot2.geom.TimeJELFunction
- All Implemented Interfaces:
DoubleUnaryOperator
Function operating on a time value as used in a Time plot.
The input value of the function is in unix seconds.
A number of variables representing time and based on that input
value are available, currently: "mjd", "jd", "unixSec" and "decYear".
Typically the expression will simply be one of these terms.
- Since:
- 15 Dec 2022
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Defines a quantity representing time that can be used in expressions supplied to this class.static class
This public class is an implementation detail, not intended for external use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
applyAsDouble
(double unixSec) Function of time in seconds since the Unix epoch.Returns the text of the function expression.static TimeJELFunction.TimeQuantity[]
Returns a list of TimeQuantity objects that can be referred to by name from expressions used by this class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.DoubleUnaryOperator
andThen, compose
-
Constructor Details
-
TimeJELFunction
Constructor.- Parameters:
fexpr
- JEL expression in terms of a time variable- Throws:
gnu.jel.CompilationException
-
-
Method Details
-
applyAsDouble
public double applyAsDouble(double unixSec) Function of time in seconds since the Unix epoch.- Specified by:
applyAsDouble
in interfaceDoubleUnaryOperator
- Parameters:
unixSec
- unix seconds- Returns:
- time representation as defined by this function
-
getExpression
Returns the text of the function expression.- Returns:
- function expression
-
getTimeQuantities
Returns a list of TimeQuantity objects that can be referred to by name from expressions used by this class.- Returns:
- ordered list of time quantities
-