public class JELFunction extends Object implements java.util.function.DoubleUnaryOperator
Instances of this class are not threadsafe, but could be made so
by putting a lock on the evaluate(double)
method.
Modifier and Type | Class and Description |
---|---|
static class |
JELFunction.XResolver
This public class is an implementation detail,
not intended for external use.
|
Constructor and Description |
---|
JELFunction(String xvarname,
String fexpr)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
applyAsDouble(double x)
Does exactly the same as
evaluate(double) . |
double |
evaluate(double x)
Evaluates this function at a given value of the independent variable.
|
String |
getExpression()
Returns the text of the function expression.
|
String |
getXVarName()
Returns the name of the independent variable.
|
static void |
main(String[] args)
Main method tests this class.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
andThen, compose, identity
public JELFunction(String xvarname, String fexpr) throws gnu.jel.CompilationException
xvarname
- name of the independent variable (for instance "x")fexpr
- text of expression giving the function value,
in terms of xvarname
(for instance "x+1")gnu.jel.CompilationException
public double evaluate(double x)
x
- variable valuepublic double applyAsDouble(double x)
evaluate(double)
.applyAsDouble
in interface java.util.function.DoubleUnaryOperator
public String getXVarName()
public String getExpression()
public static void main(String[] args)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.