public class MathExpParser
extends java.lang.Object
Description:
Title:首亨软件 - TSS/CRM等
| 构造器和说明 |
|---|
MathExpParser() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addFunction(java.lang.String functionName,
java.lang.Object function) |
void |
addStandardConstants()
Adds the constants pi and e to the parser.
|
void |
addStandardFunctions()
Adds the standard functions to the parser.
|
java.lang.Double |
addVariable(java.lang.String name,
double value)
Adds a new variable to the parser, or updates the value of an existing
variable.
|
void |
addVariableCallback(MathExpVariable_I mevCallback) |
java.lang.String |
getErrorInfo()
Reports information on the error in the expression
|
SimpleNode |
getTopNode() |
double |
getValue() |
double |
getValue(DoubleStack evalStack) |
ASTVarNode |
getVarNode(java.lang.String var) |
boolean |
hasError()
Reports whether there is an error in the expression
|
void |
initFunTab()
Initializes the function table
|
void |
initSymTab()
Initializes the symbol table
|
void |
parseExpression(java.lang.String expression_in)
Parses the expression
|
void |
setVarNode(java.lang.String var,
ASTVarNode node) |
public void addVariableCallback(MathExpVariable_I mevCallback)
public void initSymTab()
public void initFunTab()
public void addStandardFunctions()
public void addStandardConstants()
public void addFunction(java.lang.String functionName,
java.lang.Object function)
public java.lang.Double addVariable(java.lang.String name,
double value)
name - Name of the variable to be addedvalue - Initial value or new value for the variablepublic ASTVarNode getVarNode(java.lang.String var)
public void setVarNode(java.lang.String var,
ASTVarNode node)
public void parseExpression(java.lang.String expression_in)
expression_in - The input expression stringpublic double getValue()
throws ParseException
ParseExceptionpublic SimpleNode getTopNode()
public double getValue(DoubleStack evalStack) throws ParseException
ParseExceptionpublic boolean hasError()
public java.lang.String getErrorInfo()