Class IIncInstruction

    • Constructor Detail

      • IIncInstruction

        public IIncInstruction​(int opcode,
                               int offset,
                               int varIndex,
                               int constValue)
        Constructs an IIncInstruction.
        Parameters:
        opcode - The opcode of the instruction.
        offset - The bytecode offset of the instruction.
        varIndex - The index of the local variable to increment.
        constValue - The constant value to add to the local variable.
    • Method Detail

      • getConstValue

        public int getConstValue()
        Returns:
        the const value
      • write

        public void write​(DataOutputStream dos)
                   throws IOException
        Writes the IINC opcode and its operands to the DataOutputStream.
        Specified by:
        write in class Instruction
        Parameters:
        dos - The DataOutputStream to write to.
        Throws:
        IOException - If an I/O error occurs.
      • getStackChange

        public int getStackChange()
        Returns the change in stack size caused by this instruction.
        Specified by:
        getStackChange in class Instruction
        Returns:
        The stack size change (none).
      • getLocalChange

        public int getLocalChange()
        Returns the change in local variables caused by this instruction.
        Specified by:
        getLocalChange in class Instruction
        Returns:
        The local variables size change (none).
      • toString

        public String toString()
        Returns a string representation of the instruction.
        Overrides:
        toString in class Instruction
        Returns:
        The mnemonic, variable index, and constant value.