|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.numerics.ParsedFunction
public final class ParsedFunction
ParsedFunction defines a function of a single varianble using a String. This function is immutable. That is, once an instance is created with a particular function string, the function cannot be changed. Because immutable objects cannot change, they are thread safe and can be freely shared in a Java program.
Constructor Summary | |
---|---|
ParsedFunction(java.lang.String fStr)
Constructs a function x with from the given string. |
|
ParsedFunction(java.lang.String _fStr,
java.lang.String var)
Constructs a ParsedFunction from the given string and independent variable. |
Method Summary | |
---|---|
double |
evaluate(double x)
Evaluates the function, f. |
java.lang.String |
toString()
Represents the function as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ParsedFunction(java.lang.String fStr) throws ParserException
fStr
- the function
ParserException
public ParsedFunction(java.lang.String _fStr, java.lang.String var) throws ParserException
_fStr
- the functionvar
- the independent variable
ParserException
Method Detail |
---|
public double evaluate(double x)
evaluate
in interface Function
x
- the value of the independent variable
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |