Class Var

  • All Implemented Interfaces:
    Term

    public class Var
    extends java.lang.Object
    implements Term
    The Var returns a double value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double value  
    • Constructor Summary

      Constructors 
      Constructor Description
      Var()
      Constructs a Var with the initial value 0.
      Var​(double value)
      Constructs a Var with a given value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double calculate​(double... values)
      Calculates the result of this Term.
      double getValue()
      Returns the value.
      void setValue​(double value)
      Sets the value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • value

        protected double value
    • Constructor Detail

      • Var

        public Var()
        Constructs a Var with the initial value 0.
      • Var

        public Var​(double value)
        Constructs a Var with a given value.
        Parameters:
        value - the value
    • Method Detail

      • getValue

        public double getValue()
        Returns the value.
        Returns:
        the value
      • setValue

        public void setValue​(double value)
        Sets the value.
        Parameters:
        value - the value to set
      • calculate

        public double calculate​(double... values)
        Description copied from interface: Term
        Calculates the result of this Term.
        Specified by:
        calculate in interface Term
        Parameters:
        values - the values
        Returns:
        the result