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, waitandThen, compose, identitypublic 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.CompilationExceptionpublic double evaluate(double x)
x - variable valuepublic double applyAsDouble(double x)
evaluate(double).applyAsDouble in interface java.util.function.DoubleUnaryOperatorpublic String getXVarName()
public String getExpression()
public static void main(String[] args)
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.