Package com.singularsys.extensions.xjep
Class XVariable
- java.lang.Object
-
- java.util.Observable
-
- com.singularsys.jep.Variable
-
- com.singularsys.extensions.xjep.XVariable
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
DVariable
public class XVariable extends Variable
Variables which have their equations stored.- Author:
- Rich Morris Created on 28-Feb-2004
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
calcValue(XEvaluator xeval, boolean force)
Calculates the value for the variables equation and returns that value.Node
getEquation()
get the equationboolean
hasEquation()
Does this variable has an associated equation?void
setEquation(Node eqn)
sets the equationjava.lang.String
toString()
Returns a string rep of variable with its equation and value.java.lang.String
toString(PrintVisitor pv)
Returns a string rep of variable with its equation and value.-
Methods inherited from class com.singularsys.jep.Variable
getHook, getName, getValue, hasValidValue, hookKeys, isConstant, removeHook, setHook, setIsConstant, setValidValue, setValue, setValue, setValueRaw
-
-
-
-
Method Detail
-
hasEquation
public boolean hasEquation()
Does this variable has an associated equation?
-
setEquation
public void setEquation(Node eqn)
sets the equation
-
getEquation
public Node getEquation()
get the equation
-
calcValue
public java.lang.Object calcValue(XEvaluator xeval, boolean force) throws EvaluationException
Calculates the value for the variables equation and returns that value.- Parameters:
xeval
- evaluator to useforce
- whether to force re-evaluation if the variable has a valid value- Returns:
- value of variable
- Throws:
EvaluationException
-
toString
public java.lang.String toString(PrintVisitor pv)
Returns a string rep of variable with its equation and value.
-
-