Class BinaryOperation


  • public class BinaryOperation
    extends JavaExpression
    JavaExpression for binary operations.
    • Field Detail

      • operationKind

        protected final com.sun.source.tree.Tree.Kind operationKind
        The binary operation kind.
    • Constructor Detail

      • BinaryOperation

        public BinaryOperation​(javax.lang.model.type.TypeMirror type,
                               com.sun.source.tree.Tree.Kind operationKind,
                               JavaExpression left,
                               JavaExpression right)
        Create a binary operation.
        Parameters:
        type - the result type
        operationKind - the operator
        left - the left operand
        right - the right operand
      • BinaryOperation

        public BinaryOperation​(BinaryOperationNode node,
                               JavaExpression left,
                               JavaExpression right)
        Create a binary operation.
        Parameters:
        node - the binary operation node
        left - the left operand
        right - the right operand
    • Method Detail

      • getOperationKind

        public com.sun.source.tree.Tree.Kind getOperationKind()
        Returns the operator of this binary operation.
        Returns:
        the binary operation kind
      • getLeft

        public JavaExpression getLeft()
        Returns the left operand of this binary operation.
        Returns:
        the left operand
      • getRight

        public JavaExpression getRight()
        Returns the right operand of this binary operation.
        Returns:
        the right operand
      • isDeterministic

        public boolean isDeterministic​(AnnotationProvider provider)
        Description copied from class: JavaExpression
        Returns true if the expression is deterministic.
        Specified by:
        isDeterministic in class JavaExpression
        Parameters:
        provider - an annotation provider (a type factory)
        Returns:
        true if this expression is deterministic
      • containsSyntacticEqualJavaExpression

        public boolean containsSyntacticEqualJavaExpression​(JavaExpression other)
        Description copied from class: JavaExpression
        Returns true if and only if this contains a JavaExpression that is syntactically equal to other.
        Specified by:
        containsSyntacticEqualJavaExpression in class JavaExpression
        Parameters:
        other - the JavaExpression to search for
        Returns:
        true if and only if this contains a JavaExpression that is syntactically equal to other
      • containsModifiableAliasOf

        public boolean containsModifiableAliasOf​(Store<?> store,
                                                 JavaExpression other)
        Description copied from class: JavaExpression
        Returns true if and only if other appears anywhere in this or an expression appears in this such that other might alias this expression, and that expression is modifiable.

        This is always true, except for cases where the Java type information prevents aliasing and none of the subexpressions can alias 'other'.

        Overrides:
        containsModifiableAliasOf in class JavaExpression
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(@Nullable java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • accept

        public <R,​P> R accept​(JavaExpressionVisitor<R,​P> visitor,
                                    P p)
        Description copied from class: JavaExpression
        Accept method of the visitor pattern.
        Specified by:
        accept in class JavaExpression
        Type Parameters:
        R - result type of the operation
        P - parameter type
        Parameters:
        visitor - the visitor to be applied to this JavaExpression
        p - the parameter for this operation
        Returns:
        the result of visiting this