jaitools.jiffle.parser
Class ConstantLookup
java.lang.Object
jaitools.jiffle.parser.ConstantLookup
public class ConstantLookup
- extends Object
A lookup for named constants used by the Jiffle compiler.
The following constants are recognized:
M_E The base of natural logarithms (e)
M_PI Pi
M_PI_2 Pi / 2
M_PI_4 Pi / 4
M_SQRT2 Squre root of 2
In addition, any of the following can be used for Double.NaN
M_NaN
M_NAN
NaN
NAN
- Since:
- 1.1
- Version:
- $Id: ConstantLookup.java 1383 2011-02-10 11:22:29Z michael.bedward $
- Author:
- Michael Bedward
|
Method Summary |
static double |
getValue(String name)
Gets the value of a named constant. |
static boolean |
isDefined(String name)
Checks if a constant is recognized by Jiffle. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConstantLookup
public ConstantLookup()
isDefined
public static boolean isDefined(String name)
- Checks if a constant is recognized by Jiffle.
- Parameters:
name - the name
- Returns:
true if the constant is recognized;
false otherwise
getValue
public static double getValue(String name)
- Gets the value of a named constant.
- Parameters:
name - the constant
- Returns:
- the value
- Throws:
IllegalArgumentException - if name is not recognized
Copyright © 2009-2011. All Rights Reserved.