Class 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
    • Constructor Detail

      • XVariable

        public XVariable​(java.lang.String name)
      • XVariable

        public XVariable​(java.lang.String name,
                         java.lang.Object value)
    • 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 use
        force - 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.
      • toString

        public java.lang.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.