Class Constant

java.lang.Object
com.fathzer.soft.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<Double> pi = new Constant<Double>("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