java.lang.Object
studio.magemonkey.codex.util.eval.javaluator.Constant

public class Constant extends Object
A constant in an expression.
Some expressions needs constants. For instance, it is impossible to perform trigonometric calculus without using pi. A constant allows you to use mnemonic in your expressions instead of the raw value of the constant.
A constant for pi would be defined by :
Constant pi = new Constant("pi");
With such a constant, you will be able to evaluate the expression "sin(pi/4)"
Author:
Jean-Marc Astesana
See Also:
  • Constructor Details

    • Constant

      public Constant(String name)
      Constructor
      Parameters:
      name - The mnemonic of the constant.
      The name is used in expressions to identified the constants.
  • Method Details

    • getName

      public String getName()
      Gets the mnemonic of the constant.
      Returns:
      the id
    • toString

      public String toString()
      Overrides:
      toString in class Object