Class Java.BinaryOperation

  • All Implemented Interfaces:
    Java.ArrayInitializerOrRvalue, Java.ElementValue, Java.Locatable
    Enclosing class:
    Java

    public static final class Java.BinaryOperation
    extends Java.BooleanRvalue
    Representation of all non-operand-modifying binary operations.

    Operations with boolean result:

    ||
    JLS7 15.24 "conditional or operation"
    &&
    JLS7 15.23 "conditional and operation"
    ==
    JLS7 15.21 "equality operation"
    !=
    JLS7 15.22 "non-equality operation"
    < > <= >=
    JLS7 15.20.1 "numerical comparison operations"

    Operations with non-boolean result:

    |
    JLS7 15.22.1 "integer bitwise OR operation" and JLS7 15.22.2 "boolean logical OR operation"
    ^
    JLS7 15.22.1 "integer bitwise XOR operation" and JLS7 15.22.2 "boolean logical XOR operation"
    &
    JLS7 15.22.1 "integer bitwise AND operation" and JLS7 15.22.2 "boolean logical AND operation"
    * / %
    JLS7 15.17 "multiplicative operations"
    + -
    JLS7 15.18 "additive operations"
    << >> >>>
    JLS7 15.19 "shift operations"
    • Field Detail

      • lhs

        public final Java.Rvalue lhs
        The left hand side operand.
      • operator

        public final java.lang.String operator
        The operator, as an interned string.
        See Also:
        Java.BinaryOperation
      • rhs

        public final Java.Rvalue rhs
        The right hand side operand.
    • Method Detail

      • toString

        public java.lang.String toString()
        Specified by:
        toString in class Java.Atom
      • unrollLeftAssociation

        public java.util.Iterator<Java.Rvalue> unrollLeftAssociation()
        Transforms this binary operation into an Iterator over a left-to-right sequence of Java.Rvalues.

        That iterator produces two elements (the left-hand-side and the right-hand-side of this operation), or, iff the left-hand-side of this operation is itself a binary operation with the same operator, then the iterator produces the sequence of the unrolled operands.