org.jaitools.jiffle.parser
Class ConstantLookup

java.lang.Object
  extended by org.jaitools.jiffle.parser.ConstantLookup

public class ConstantLookup
extends java.lang.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:
0.1
Version:
$Id: ConstantLookup.java 1653 2011-06-16 10:23:02Z michael.bedward $
Author:
Michael Bedward

Constructor Summary
ConstantLookup()
           
 
Method Summary
static double getValue(java.lang.String name)
          Gets the value of a named constant.
static boolean isDefined(java.lang.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
 

Constructor Detail

ConstantLookup

public ConstantLookup()
Method Detail

isDefined

public static boolean isDefined(java.lang.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(java.lang.String name)
Gets the value of a named constant.

Parameters:
name - the constant
Returns:
the value
Throws:
java.lang.IllegalArgumentException - if name is not recognized


Copyright © 2011. All Rights Reserved.