Class IincInsn

  • All Implemented Interfaces:
    Serializable, ByteCode

    public class IincInsn
    extends Object
    implements ByteCode
    Increment local variable by constant (jvm spec).

    Operation

    Increment local variable by constant

    Format

     iinc
     index
     const
     

    Forms

    iinc = 132 (0x84)

    Operand Stack

    No change

    Description

    The index is an unsigned byte that must be an index into the local variable array of the current frame (§2.6). The const is an immediate signed byte. The local variable at index must contain an int. The value const is first sign-extended to an int, and then the local variable at index is incremented by that amount.

    Notes

    The iinc opcode can be used in conjunction with the wide instruction (§wide) to access a local variable using a two-byte unsigned index and to increment it by a two-byte immediate signed value.
    See Also:
    Serialized Form
    • Constructor Detail

      • IincInsn

        public IincInsn()
      • IincInsn

        public IincInsn​(int variable,
                        int increment)
    • Method Detail

      • getVariable

        public int getVariable()
      • setVariable

        public void setVariable​(int variable)
      • getIncrement

        public int getIncrement()
      • setIncrement

        public void setIncrement​(int increment)