Package de.xima.fc.workflow.parser.infix
Interface IEvalContext<TData,TConstant extends IConstant,TOperator extends IOperator>
-
- Type Parameters:
TConstant
- Type of the implementation for constant symbols.TOperator
- Type of the implementation for operator symbols.TData
- Type of the data being handled by this evaluator.
public interface IEvalContext<TData,TConstant extends IConstant,TOperator extends IOperator>
Context for evaluating an infix expression. Users may provide custom context with additional logic.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TData
evalConstant(TConstant constant)
Evaluates the given constant and returns the value of that constant.TData
evalInfix(TOperator operator, TData arg1, TData arg2)
Evaluates the given infix operator operating on the two given arguments.TData
evalPostfix(TOperator operator, TData arg1)
Evaluates the given postfix operator operating on the given argument.TData
evalPrefix(TOperator operator, TData arg1)
Evaluates the given prefix operator operating on the given argument.TData
evalVariable(String name)
Finds and returns the value of the variable with the given name.
-
-
-
Method Detail
-
evalConstant
TData evalConstant(TConstant constant) throws Exception
Evaluates the given constant and returns the value of that constant.- Parameters:
constant
- Constant to evaluate.- Returns:
- The value of the constant.
- Throws:
Exception
- When the constant could not be evaluated for any reason. When this exception is thrown, it is wrapped in aInfixExpressionException
which is then throw by the evaluator.
-
evalInfix
TData evalInfix(TOperator operator, TData arg1, TData arg2) throws Exception
Evaluates the given infix operator operating on the two given arguments.- Parameters:
operator
- Operator to evaluate.arg1
- Argument to the left of the infix operator.arg2
- Argument to the right of the infix operator.- Returns:
- The value resulting from an application of the given operator to the arguments.
- Throws:
Exception
- When the operator could not be evaluated for any reason. When this exception is thrown, it is wrapped in aInfixExpressionException
which is then throw by the evaluator.
-
evalPostfix
TData evalPostfix(TOperator operator, TData arg1) throws Exception
Evaluates the given postfix operator operating on the given argument.- Parameters:
operator
- Operator to evaluate.arg1
- Argument to the left of the postfix operator.- Returns:
- The value resulting from an application of the given operator to the argument.
- Throws:
Exception
- When the operator could not be evaluated for any reason. When this exception is thrown, it is wrapped in aInfixExpressionException
which is then throw by the evaluator.
-
evalPrefix
TData evalPrefix(TOperator operator, TData arg1) throws Exception
Evaluates the given prefix operator operating on the given argument.- Parameters:
operator
- Operator to evaluate.arg1
- Argument to the right of the prefix operator.- Returns:
- The value resulting from an application of the given operator to the argument.
- Throws:
Exception
- When the operator could not be evaluated for any reason. When this exception is thrown, it is wrapped in aInfixExpressionException
which is then throw by the evaluator.
-
-