edu.stanford.rsl.konrad.numerics.mathexpressions
Class Evaluator

java.lang.Object
  extended by edu.stanford.rsl.konrad.numerics.mathexpressions.Evaluator

public class Evaluator
extends java.lang.Object

Class for evaluating simple algebraic expressions Custom functions can be defined in functionexpression.java

Author:
Rotimi X Ojo

Constructor Summary
Evaluator()
           
 
Method Summary
static Plane3D getPlane(java.lang.String expression)
          Evaluates string literals of form (x,y,z) >(<) offset, where (x,y,z) is a normal vector;
static Plane3D getPlane(java.lang.String expression, java.util.Map<java.lang.String,java.lang.Double> variablesMap)
           
static PointND getPointValue(java.lang.String expression)
          Evaluates the string literals in a string vector;
static PointND getPointValue(java.lang.String expression, java.util.Map<java.lang.String,java.lang.Double> variablesMap)
          Evaluates the string literals in a string vector and replaces variables with values in map;
static double getValue(java.lang.String expression)
          Evaluates the string literal
static double getValue(java.lang.String expression, java.util.Map<java.lang.String,java.lang.Double> variablesMap)
          Evaluates the string literal and replaces variables with values in map;
static SimpleVector getVectorValue(java.lang.String expression)
          Evaluates the string literals in a string vector;
static SimpleVector getVectorValue(java.lang.String expression, java.util.Map<java.lang.String,java.lang.Double> variablesMap)
          Evaluates the string literals in a string vector and replaces variables with values in map;
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Evaluator

public Evaluator()
Method Detail

getValue

public static double getValue(java.lang.String expression)
Evaluates the string literal

Parameters:
expression - string to be evaluated
Returns:
value of string;

getValue

public static double getValue(java.lang.String expression,
                              java.util.Map<java.lang.String,java.lang.Double> variablesMap)
Evaluates the string literal and replaces variables with values in map;

Parameters:
expression - string to be evaluated
Returns:
value of string;

getVectorValue

public static SimpleVector getVectorValue(java.lang.String expression)
Evaluates the string literals in a string vector;

Parameters:
expression - string vector to be evaluated
Returns:
vector value of string;

getVectorValue

public static SimpleVector getVectorValue(java.lang.String expression,
                                          java.util.Map<java.lang.String,java.lang.Double> variablesMap)
Evaluates the string literals in a string vector and replaces variables with values in map;

Parameters:
expression - string vector to be evaluated
Returns:
vector value of string;

getPointValue

public static PointND getPointValue(java.lang.String expression)
Evaluates the string literals in a string vector;

Parameters:
expression - string vector to be evaluated
Returns:
point value of string;

getPointValue

public static PointND getPointValue(java.lang.String expression,
                                    java.util.Map<java.lang.String,java.lang.Double> variablesMap)
Evaluates the string literals in a string vector and replaces variables with values in map;

Parameters:
expression - string vector to be evaluated
Returns:
point value of string;

getPlane

public static Plane3D getPlane(java.lang.String expression)
Evaluates string literals of form (x,y,z) >(<) offset, where (x,y,z) is a normal vector;

Parameters:
expression - string expression of form (x,y,z) >(<) offset, where (x,y,z) is a normal vector;
Returns:
the plane defined by string expression;

getPlane

public static Plane3D getPlane(java.lang.String expression,
                               java.util.Map<java.lang.String,java.lang.Double> variablesMap)