|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.jel.JELFunction
public class JELFunction
Provides a double precision function of one double precision variable which can be evaluated using JEL. The variable name and an expression giving the result in terms of that variable name are supplied.
Instances of this class are not threadsafe, but could be made so
by putting a lock on the evaluate(double)
method.
Nested Class Summary | |
---|---|
static class |
JELFunction.XResolver
This public class is an implementation detail, not intended for external use. |
Constructor Summary | |
---|---|
JELFunction(String xvarname,
String fexpr)
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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
Method Detail |
---|
public double evaluate(double x)
x
- variable value
public String getXVarName()
public String getExpression()
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |