Class XVariable

java.lang.Object
com.singularsys.jep.Variable
com.singularsys.extensions.xjep.XVariable
All Implemented Interfaces:
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:
  • Constructor Details

    • XVariable

      public XVariable(String name)
    • XVariable

      public XVariable(String name, Object value)
  • Method Details

    • 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 Object calcValue(XEvaluator xeval, boolean force) throws EvaluationException
      Calculates the value for the variables equation and returns that value.
      Parameters:
      xeval - evaluator to use
      force - whether to force re-evaluation if the variable has a valid value
      Returns:
      value of variable
      Throws:
      EvaluationException
    • toString

      public String toString(PrintVisitor pv)
      Returns a string rep of variable with its equation and value.
    • toString

      public String toString()
      Returns a string rep of variable with its equation and value.
      Overrides:
      toString in class Variable
      Returns:
      A string with the variable name and value.