|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.StreamTokenizer
org.jscience.physics.fluids.dynamics.util.EvaluateExpression
public class EvaluateExpression
This class is used to interprete mathematical expressions. The code is mostly from the Aray v7.0 programed by myself. The possibilities of the interpreter are infinite, you can introduce new functions and interconect them with other parts of the program.
| Field Summary | |
|---|---|
java.lang.String |
VERSION
version of the class |
| Fields inherited from class java.io.StreamTokenizer |
|---|
nval, sval, TT_EOF, TT_EOL, TT_NUMBER, TT_WORD, ttype |
| Constructor Summary | |
|---|---|
EvaluateExpression(java.lang.String expression)
Constructor of the class. |
|
| Method Summary | |
|---|---|
void |
assignsVariable(java.lang.String name,
double value)
Introduce a new variable in the list of variables of the user. |
double |
result()
Returns the value of the expression. |
double |
result(double xv,
double yv)
Returns the result of a expression type F(x,y). |
double |
result(double xv,
double yv,
double zv)
Returns the result of a expression type F(x,y,z). |
| Methods inherited from class java.io.StreamTokenizer |
|---|
commentChar, eolIsSignificant, lineno, lowerCaseMode, nextToken, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.String VERSION
| Constructor Detail |
|---|
public EvaluateExpression(java.lang.String expression)
expression - | Method Detail |
|---|
public void assignsVariable(java.lang.String name,
double value)
name - string with the name of the variable.value - numerical value to be assigned.public double result()
assignsVariable.
public double result(double xv,
double yv)
assignsVariable for the indicated values of x
and y.
xv - DOCUMENT ME!yv - DOCUMENT ME!
public double result(double xv,
double yv,
double zv)
assignsVariable for the indicated values of x
and yz.
xv - yv - zv -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||