Package com.exasol.sql.expression
Class BinaryArithmeticExpression
- java.lang.Object
-
- com.exasol.sql.expression.BinaryArithmeticExpression
-
- All Implemented Interfaces:
ValueExpression
public class BinaryArithmeticExpression extends Object implements ValueExpression
This class represents a binary arithmetic expression.Examples: +, -, *, /
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BinaryArithmeticExpression.BinaryArithmeticOperator
This enum represents arithmetic operators in an SQL statement.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ValueExpressionVisitor visitor)
Accept a visitorValueExpression
getLeft()
Get a left operand of the arithmetic expression.ValueExpression
getRight()
Get a right operand of the arithmetic expression.String
getStringOperatorRepresentation()
Get a string representation of a member of this enum class.static BinaryArithmeticExpression
of(BinaryArithmeticExpression.BinaryArithmeticOperator operator, ValueExpression left, ValueExpression right)
Create a newBinaryArithmeticExpression
instance.
-
-
-
Method Detail
-
of
public static BinaryArithmeticExpression of(BinaryArithmeticExpression.BinaryArithmeticOperator operator, ValueExpression left, ValueExpression right)
Create a newBinaryArithmeticExpression
instance.- Parameters:
operator
- arithmetic operator represented byBinaryArithmeticExpression.BinaryArithmeticOperator
left
- left part of the expressionright
- right part of the expression- Returns:
- new
BinaryArithmeticExpression
instance
-
getStringOperatorRepresentation
public String getStringOperatorRepresentation()
Get a string representation of a member of this enum class. For example, + represents an ADD operator.- Returns:
- string representation of an arithmetic operator
-
accept
public void accept(ValueExpressionVisitor visitor)
Description copied from interface:ValueExpression
Accept a visitor- Specified by:
accept
in interfaceValueExpression
- Parameters:
visitor
- visitor to accept
-
getLeft
public ValueExpression getLeft()
Get a left operand of the arithmetic expression.- Returns:
- left operand
-
getRight
public ValueExpression getRight()
Get a right operand of the arithmetic expression.- Returns:
- right operand
-
-