Package 

Class Instruction

  • All Implemented Interfaces:

    
    public abstract class Instruction
    
                        

    Base class for all opcode instruction wrappers.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer getOffset() Offset of this instruction in its parent Code attribute.
      final Unit setOffset(Integer offset) Offset of this instruction in its parent Code attribute.
      Integer getSize()
      final Opcode getOpcode() Opcode of this instruction.
      Integer getPaddedSize(Integer offset) Get the padded size in bytes of this instruction.
      Unit read(ByteCodeInput input) Read this instruction from the given ByteCodeInput.
      Unit write(ByteCodeOutput output) Write this instruction to the given ByteCodeOutput.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Instruction

        Instruction(Opcode opcode)
    • Method Detail

      • getOffset

         final Integer getOffset()

        Offset of this instruction in its parent Code attribute.

      • setOffset

         final Unit setOffset(Integer offset)

        Offset of this instruction in its parent Code attribute.

      • getPaddedSize

         Integer getPaddedSize(Integer offset)

        Get the padded size in bytes of this instruction. This will be the same as size except for instances of PaddedInstruction.

        Parameters:
        offset - the offset at which this instruction is found.
      • read

         Unit read(ByteCodeInput input)

        Read this instruction from the given ByteCodeInput. Expects ByteCodeInput to be in JVM class file format and just before a instruction of this kind.

        Parameters:
        input - the ByteCodeInput from which to read
      • write

         Unit write(ByteCodeOutput output)

        Write this instruction to the given ByteCodeOutput.

        Parameters:
        output - the ByteCodeOutput to which to write