fr.expression4j.basic
Interface ExpressionElement

All Known Implementing Classes:
BinaryOperatorExpressionElement, ComplexOrRealExpressionElement, ConstantOrVariableExpressionElement, ConstantOrVariableWithoutCheckExpressionElement, ExpressionExpressionElement, FunctionDefExpressionElement, FunctionExpressionElement, FunctionNameExpressionElement, IntegerExpressionElement, ParametersDefExpressionElement, ParametersExpressionElement, ParenthesisExpressionElement, RealExpressionElement, RealSimpleExpressionElement, SignedExpressionExpressionElement, SignedIntegerExpressionElement, SimpleExpressionExpressionElement, StringExpressionElement, UnaryOperatorExpressionElement

public interface ExpressionElement


Method Summary
 MathematicalElement evaluate(TreeElement element, Catalog catalog, OperatorManager operatorManager, Parameters parameters, ExpressionModel model)
          Evaluate the value of the current expression element
 java.lang.String getName()
          get the name of the element (like integer, variable ...)
 boolean parseElement(java.lang.String expression, ExpressionModel expressionModel, ParseInfo parseInfo, Catalog catalog, java.util.List functionParameters, int priorityOperatorLevel)
          Parse an element of an expression like term, real, integer ...
 java.lang.String toString(TreeElement element, ExpressionModel expressionModel)
          Create the String object associated to the expression element.
 

Method Detail

parseElement

boolean parseElement(java.lang.String expression,
                     ExpressionModel expressionModel,
                     ParseInfo parseInfo,
                     Catalog catalog,
                     java.util.List functionParameters,
                     int priorityOperatorLevel)
                     throws ParsingException
Parse an element of an expression like term, real, integer ... (See BNF)

Parameters:
expression - expression to parse.
expressionModel - meta model of expression.
parseInfo - info about parsing
catalog - function and constant catalog
functionParameters - parameters of the function (f(x), x is a parameter)
priorityOperatorLevel - priority of current operator.
Returns:
true if the expression content the element at the given position.
Throws:
ParsingException

getName

java.lang.String getName()
get the name of the element (like integer, variable ...)

Returns:
the name of the element

evaluate

MathematicalElement evaluate(TreeElement element,
                             Catalog catalog,
                             OperatorManager operatorManager,
                             Parameters parameters,
                             ExpressionModel model)
                             throws EvalException
Evaluate the value of the current expression element

Parameters:
element - tree element of the expression.
operatorManager - operator manager of the current expression.
parameters - parameters given to the expression.
Returns:
the evaluated value of the expression.
Throws:
EvalException

toString

java.lang.String toString(TreeElement element,
                          ExpressionModel expressionModel)
Create the String object associated to the expression element.

Parameters:
element - element properties for convertion.
expressionModel - expression model to use for current expression element.
Returns:
the string of the element.