public class ParsedEquation extends java.lang.Object implements Expression, Equation
| Constructor and Description |
|---|
ParsedEquation() |
| Modifier and Type | Method and Description |
|---|---|
void |
addVariable(Variable var) |
Constant |
createBooleanConstant(boolean value) |
Constant |
createConstant(java.lang.String expr) |
void |
endParsing() |
java.lang.Object |
eval()
Evaluate the expression.
|
Expression |
getExpression()
Return the associated expression.
|
java.lang.String |
getExpressionName()
Return the expression name.
|
Expression |
getRoot()
Return the root expression.
|
Variable |
getVariable(java.lang.String varName)
Return a variable declared by the expression.
|
java.util.Map<java.lang.String,Variable> |
getVariables()
Return the variables used by this expression.
|
void |
setExpression(Expression expr) |
void |
setVariables(java.util.List<Variable> varsList) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetVariable, getVariables, hasVariable, hasVariablepublic java.lang.String getExpressionName()
ExpressiongetExpressionName in interface Expressionpublic void endParsing()
public void setExpression(Expression expr)
public java.util.Map<java.lang.String,Variable> getVariables()
int c=a+b, only "a" and "b" will be returned.getVariables in interface Expressionpublic Expression getExpression()
ExpressiongetExpression in interface EquationgetExpression in interface Expressionpublic Expression getRoot()
getRoot in interface Expressionpublic void addVariable(Variable var)
public void setVariables(java.util.List<Variable> varsList)
public Variable getVariable(java.lang.String varName)
ExpressiongetVariable in interface ExpressionvarName - the variable namepublic Constant createBooleanConstant(boolean value)
public Constant createConstant(java.lang.String expr)
public java.lang.Object eval()
throws java.lang.ArithmeticException
Expressioneval in interface Expressionjava.lang.ArithmeticExceptionCopyright © 2019-2025 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence