Package com.blazebit.expression
Class ChainingArithmeticExpression
- java.lang.Object
-
- com.blazebit.expression.AbstractExpression
-
- com.blazebit.expression.ChainingArithmeticExpression
-
- All Implemented Interfaces:
ArithmeticExpression
,Expression
public class ChainingArithmeticExpression extends AbstractExpression implements ArithmeticExpression
An arithmetic expression connecting two arithmetic expression operands with an arithmetic operator.- Since:
- 1.0.0
- Author:
- Christian Beikov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.blazebit.expression.Expression
Expression.ResultVisitor<T>, Expression.Visitor
-
-
Constructor Summary
Constructors Constructor Description ChainingArithmeticExpression(com.blazebit.domain.runtime.model.DomainType type, ArithmeticExpression left, ArithmeticExpression right, ArithmeticOperatorType operator)
Creates a new expression from the given operands and the given operator returning a result of the given domain type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
accept(Expression.ResultVisitor<T> visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.void
accept(Expression.Visitor visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.boolean
equals(Object o)
ArithmeticExpression
getLeft()
Returns the left operand.ArithmeticOperatorType
getOperator()
Returns the arithmetic operator.ArithmeticExpression
getRight()
Returns the right operand.int
hashCode()
-
Methods inherited from class com.blazebit.expression.AbstractExpression
getType
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.blazebit.expression.Expression
getType, getUsedPaths
-
-
-
-
Constructor Detail
-
ChainingArithmeticExpression
public ChainingArithmeticExpression(com.blazebit.domain.runtime.model.DomainType type, ArithmeticExpression left, ArithmeticExpression right, ArithmeticOperatorType operator)
Creates a new expression from the given operands and the given operator returning a result of the given domain type.- Parameters:
type
- The result domain typeleft
- The left operandright
- The right operandoperator
- The operator
-
-
Method Detail
-
getLeft
public ArithmeticExpression getLeft()
Returns the left operand.- Returns:
- the left operand
-
getRight
public ArithmeticExpression getRight()
Returns the right operand.- Returns:
- the right operand
-
getOperator
public ArithmeticOperatorType getOperator()
Returns the arithmetic operator.- Returns:
- the arithmetic operator
-
accept
public void accept(Expression.Visitor visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.- Specified by:
accept
in interfaceExpression
- Parameters:
visitor
- The visitor to call visit on
-
accept
public <T> T accept(Expression.ResultVisitor<T> visitor)
Dynamic dispatch to one of the visit methods of the visitor, based on the runtime type.- Specified by:
accept
in interfaceExpression
- Type Parameters:
T
- The result type- Parameters:
visitor
- The visitor to call visit on- Returns:
- the value as returned by the result visitor
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractExpression
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractExpression
-
-