fr.expression4j.util
Class ExpressionUtil

java.lang.Object
  extended by fr.expression4j.util.ExpressionUtil

public class ExpressionUtil
extends java.lang.Object


Constructor Summary
ExpressionUtil()
           
 
Method Summary
static MathematicalElement computeElement(java.lang.String way, TreeElement rootElement, Catalog catalog, OperatorManager operatorManager, Parameters parameters, ExpressionModel expressionModel)
          Compute the value of a TreeElement and return is value.
static MathematicalElement computeElement(TreeElement element, Catalog catalog, OperatorManager operatorManager, Parameters parameters, ExpressionModel expressionModel)
          Compute the value of a TreeElement and return is value.
static StringElement toString(TreeElement element, ExpressionModel expressionModel)
          Transform the expression tree element in String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionUtil

public ExpressionUtil()
Method Detail

computeElement

public static MathematicalElement computeElement(TreeElement element,
                                                 Catalog catalog,
                                                 OperatorManager operatorManager,
                                                 Parameters parameters,
                                                 ExpressionModel expressionModel)
                                          throws EvalException
Compute the value of a TreeElement and return is value.

Parameters:
element - expression tree element.
catalog - catalog used to parse expression.
operatorManager - operator manager to use for the expression evaluation.
parameters - parameters to use for the expression evaluation.
expressionModel - model used to parse the expresion.
Returns:
the evaluated value.
Throws:
EvalException - if an error occurd.

computeElement

public static MathematicalElement computeElement(java.lang.String way,
                                                 TreeElement rootElement,
                                                 Catalog catalog,
                                                 OperatorManager operatorManager,
                                                 Parameters parameters,
                                                 ExpressionModel expressionModel)
                                          throws EvalException
Compute the value of a TreeElement and return is value.

Parameters:
way - way in tree element to the current node.
rootElement - expression root tree element.
catalog - catalog used to parse expression.
operatorManager - operator manager to use for the expression evaluation.
parameters - parameters to use for the expression evaluation.
expressionModel - model used to parse the expresion.
Returns:
the evaluated value.
Throws:
EvalException - if an error occurd.

toString

public static StringElement toString(TreeElement element,
                                     ExpressionModel expressionModel)
Transform the expression tree element in String.

Parameters:
element - tree element to transform.
expressionModel - model used by the parser to construct the expression tree element.
Returns:
the string representing the element.