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

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

public class MathExpression
extends AbstractMathExpression

A wrapper class of mathematical expressions

Author:
Rotimi X Ojo

Constructor Summary
MathExpression(java.lang.String expression)
           
 
Method Summary
 double evaluate(java.util.Map<java.lang.String,java.lang.Double> variablesMap)
          Determines the value of string expression represented by this class by replacing variables with values provided in map; If expression has no variable evaluate() should be called;
 java.lang.String toString()
          Converts a mathematical expression an equivalent string literal
 
Methods inherited from class edu.stanford.rsl.konrad.numerics.mathexpressions.AbstractMathExpression
evaluate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MathExpression

public MathExpression(java.lang.String expression)
Method Detail

evaluate

public double evaluate(java.util.Map<java.lang.String,java.lang.Double> variablesMap)
Description copied from class: AbstractMathExpression
Determines the value of string expression represented by this class by replacing variables with values provided in map; If expression has no variable evaluate() should be called;

Specified by:
evaluate in class AbstractMathExpression
Returns:
the evaluation result

toString

public java.lang.String toString()
Description copied from class: AbstractMathExpression
Converts a mathematical expression an equivalent string literal

Specified by:
toString in class AbstractMathExpression