public class JELFunction
extends java.lang.Object
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(java.lang.String xvarname,
java.lang.String fexpr)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
evaluate(double x)
Evaluates this function at a given value of the independent variable.
|
java.lang.String |
getExpression()
Returns the text of the function expression.
|
java.lang.String |
getXVarName()
Returns the name of the independent variable.
|
static void |
main(java.lang.String[] args)
Main method tests this class.
|
public JELFunction(java.lang.String xvarname, java.lang.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 java.lang.String getXVarName()
public java.lang.String getExpression()
public static void main(java.lang.String[] args)
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.