All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fathzer.soft.javaluator.Constant Maven / Gradle / Ivy

There is a newer version: 3.0.5
Show newest version
package com.fathzer.soft.javaluator;

/**
 * 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 License information * @see AbstractEvaluator#evaluate(Constant, Object) */ public class Constant { private String name; /** Constructor * @param name The mnemonic of the constant. *
The name is used in expressions to identified the constants. */ public Constant(String name) { this.name = name; } /** Gets the mnemonic of the constant. * @return the id */ public String getName() { return name; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy