Package org.codehaus.groovy.classgen.asm

# Class BinaryBooleanExpressionHelper

java.lang.Object
org.codehaus.groovy.classgen.asm.BinaryExpressionWriter
org.codehaus.groovy.classgen.asm.BinaryIntExpressionHelper
org.codehaus.groovy.classgen.asm.BinaryBooleanExpressionHelper

public class BinaryBooleanExpressionHelper extends BinaryIntExpressionHelper
Binary write operations specialised for Booleans

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BinaryBooleanExpressionHelper(WriterController wc)`
  Creates a boolean-specialized binary expression helper.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `doubleTwoOperands(org.objectweb.asm.MethodVisitor mv)`
  Duplicates the two operands already on the operand stack.
  `protected ClassNode`
  `getArrayGetResultType()`
  `protected ClassNode`
  `getDevisionOpResultType()`
  `protected ClassNode`
  `getNormalOpResultType()`
  `protected int`
  `getShiftOperationBytecode(int type)`
  Returns the shift opcode for the supplied token.
  `protected int`
  `getStandardOperationBytecode(int type)`
  Returns the arithmetic opcode for the supplied token.
  `protected void`
  `removeTwoOperands(org.objectweb.asm.MethodVisitor mv)`
  Removes the two operands already on the operand stack.
  `protected boolean`
  `writeDivision(boolean simulate)`
  Writes a division operation for the current primitive type.
  `protected void`
  `writeMinusMinus(org.objectweb.asm.MethodVisitor mv)`
  Emits a prefix/postfix decrement.
  `protected void`
  `writePlusPlus(org.objectweb.asm.MethodVisitor mv)`
  Emits a prefix/postfix increment.
  `boolean`
  `writePostOrPrefixMethod(int operation, boolean simulate)`
  Attempts to write a postfix or prefix increment/decrement operation.
  `protected boolean`
  `writeStdOperators(int type, boolean simulate)`
  Writes a standard arithmetic operator for the current primitive type.

  ### Methods inherited from class org.codehaus.groovy.classgen.asm.BinaryIntExpressionHelper

  `getBitwiseOperationBytecode, getCompareCode, supportsDivision, writeSpaceship, writeStdCompare`

  ### Methods inherited from class org.codehaus.groovy.classgen.asm.BinaryExpressionWriter

  `arrayGet, arraySet, getArrayGetCaller, getArraySetCaller, getController, setArraySetAndGet, write, writeBitwiseOp, writeShiftOp`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BinaryBooleanExpressionHelper

    public BinaryBooleanExpressionHelper(WriterController wc)
    Creates a boolean-specialized binary expression helper.
    Parameters:
      `wc` - the active writer controller

- ## Method Details

  - ### getArrayGetResultType

    protected ClassNode getArrayGetResultType()
    Overrides:
      `getArrayGetResultType` in class `BinaryExpressionWriter`
    Returns:
      the result type produced by `BinaryExpressionWriter.getArrayGetCaller()`

  - ### writePostOrPrefixMethod

    public boolean writePostOrPrefixMethod(int operation, boolean simulate)
    Attempts to write a postfix or prefix increment/decrement operation.
    Overrides:
      `writePostOrPrefixMethod` in class `BinaryExpressionWriter`
    Parameters:
      `operation` - the token type
      `simulate` - whether to probe support without emitting bytecode
    Returns:
      `true` if the operation is supported

  - ### writeStdOperators

    protected boolean writeStdOperators(int type, boolean simulate)
    Writes a standard arithmetic operator for the current primitive type.
    Overrides:
      `writeStdOperators` in class `BinaryExpressionWriter`
    Parameters:
      `type` - the token type
      `simulate` - whether to probe support without emitting bytecode
    Returns:
      `true` if the operation is supported

  - ### writeDivision

    protected boolean writeDivision(boolean simulate)
    Writes a division operation for the current primitive type.
    Overrides:
      `writeDivision` in class `BinaryExpressionWriter`
    Parameters:
      `simulate` - whether to probe support without emitting bytecode
    Returns:
      `true` if division is supported

  - ### getNormalOpResultType

    protected ClassNode getNormalOpResultType()
    Overrides:
      `getNormalOpResultType` in class `BinaryIntExpressionHelper`
    Returns:
      the result type for normal arithmetic operations

  - ### getDevisionOpResultType

    protected ClassNode getDevisionOpResultType()
    Overrides:
      `getDevisionOpResultType` in class `BinaryIntExpressionHelper`
    Returns:
      the result type for division operations

  - ### getShiftOperationBytecode

    protected int getShiftOperationBytecode(int type)
    Returns the shift opcode for the supplied token.
    Overrides:
      `getShiftOperationBytecode` in class `BinaryIntExpressionHelper`
    Parameters:
      `type` - the normalized token index
    Returns:
      the ASM opcode

  - ### getStandardOperationBytecode

    protected int getStandardOperationBytecode(int type)
    Returns the arithmetic opcode for the supplied token.
    Overrides:
      `getStandardOperationBytecode` in class `BinaryIntExpressionHelper`
    Parameters:
      `type` - the normalized token index
    Returns:
      the ASM opcode

  - ### removeTwoOperands

    protected void removeTwoOperands(org.objectweb.asm.MethodVisitor mv)
    Removes the two operands already on the operand stack.
    Overrides:
      `removeTwoOperands` in class `BinaryIntExpressionHelper`
    Parameters:
      `mv` - the current method visitor

  - ### writePlusPlus

    protected void writePlusPlus(org.objectweb.asm.MethodVisitor mv)
    Emits a prefix/postfix increment.
    Overrides:
      `writePlusPlus` in class `BinaryIntExpressionHelper`
    Parameters:
      `mv` - the current method visitor

  - ### writeMinusMinus

    protected void writeMinusMinus(org.objectweb.asm.MethodVisitor mv)
    Emits a prefix/postfix decrement.
    Overrides:
      `writeMinusMinus` in class `BinaryIntExpressionHelper`
    Parameters:
      `mv` - the current method visitor

  - ### doubleTwoOperands

    protected void doubleTwoOperands(org.objectweb.asm.MethodVisitor mv)
    Duplicates the two operands already on the operand stack.
    Overrides:
      `doubleTwoOperands` in class `BinaryIntExpressionHelper`
    Parameters:
      `mv` - the current method visitor