Class ArithmeticExpression
- java.lang.Object
-
- com.aquima.interactions.expressions.optimizer.nodes.ArithmeticExpression
-
- All Implemented Interfaces:
IExpressionNode
,Serializable
public class ArithmeticExpression extends Object implements IExpressionNode
The arithmetic expression is used to compute a new value using two single values.- Since:
- 6.4
- Author:
- O. Kerpershoek
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArithmeticExpression(DataType resultType, IExpressionNode left, Operator opr, IExpressionNode right)
Constructs the arithmetic expression with the required arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IValue
evaluate(IValueEnvironment environment)
This method evaluates the node using the environment passed as argument and returns the result as a value or null if the result is unknown.String
toString()
-
-
-
Constructor Detail
-
ArithmeticExpression
public ArithmeticExpression(DataType resultType, IExpressionNode left, Operator opr, IExpressionNode right)
Constructs the arithmetic expression with the required arguments.- Parameters:
resultType
- The type the result should be converted to (determined in the semantics).left
- The left hand side expression.opr
- The operator that should be used when comparing.right
- The right hand side expression.
-
-
Method Detail
-
evaluate
public IValue evaluate(IValueEnvironment environment)
Description copied from interface:IExpressionNode
This method evaluates the node using the environment passed as argument and returns the result as a value or null if the result is unknown.- Specified by:
evaluate
in interfaceIExpressionNode
- Parameters:
environment
- The environment that should be used when evaluating the node.- Returns:
- The result of the evaluation, or null if the result is unknown.
-
-