public final class VariableReference extends Object implements Expression
| Constructor and Description |
|---|
VariableReference(Variable var)
Creates a new reference to the given variable.
|
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
evaluate(MathContext mathContext)
Evaluates the expression to a BigDecimal number.
|
boolean |
isConstant()
Determines the this expression is constant
|
Expression |
simplify(MathContext mathContext)
Returns a simplified version of this expression.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitevaluate, getMathContextpublic VariableReference(Variable var)
var - the variable to access when this expression is evaluatedpublic BigDecimal evaluate(MathContext mathContext)
Expressionevaluate in interface ExpressionmathContext - Use this math context during calculation instead of the one provided during parsing. Does not
affect already simplified subexpressions.public boolean isConstant()
ExpressionisConstant in interface Expressionpublic Expression simplify(MathContext mathContext)
Expressionsimplify in interface ExpressionmathContext - Match context used during simplification.Copyright © 2019. All rights reserved.