Class InvokeInterfaceInstruction

  • All Implemented Interfaces:
    InvokeInsn

    public class InvokeInterfaceInstruction
    extends Instruction
    implements InvokeInsn
    Represents the INVOKEINTERFACE instruction (0xB9).
    • Constructor Detail

      • InvokeInterfaceInstruction

        public InvokeInterfaceInstruction​(ConstPool constPool,
                                          int opcode,
                                          int offset,
                                          int methodIndex,
                                          int count)
        Constructs an InvokeInterfaceInstruction.
        Parameters:
        constPool - The constant pool associated with the class.
        opcode - The opcode of the instruction.
        offset - The bytecode offset of the instruction.
        methodIndex - The constant pool index for the interface method reference.
        count - The number of arguments the method takes (including the object reference).
    • Method Detail

      • getMethodIndex

        public int getMethodIndex()
        Returns:
        the method index
      • getCount

        public int getCount()
        Returns:
        the count
      • write

        public void write​(DataOutputStream dos)
                   throws IOException
        Writes the INVOKEINTERFACE 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 (depends on method signature).
      • 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).
      • resolveMethod

        public String resolveMethod()
        Resolves and returns a string representation of the interface method.
        Returns:
        The interface method as a string.
      • getMethodName

        public String getMethodName()
        Returns the method name.
        Specified by:
        getMethodName in interface InvokeInsn
        Returns:
        The method name.
      • getMethodDescriptor

        public String getMethodDescriptor()
        Returns the method descriptor.
        Specified by:
        getMethodDescriptor in interface InvokeInsn
        Returns:
        The method descriptor.
      • getOwnerClass

        public String getOwnerClass()
        Returns the owner interface name.
        Specified by:
        getOwnerClass in interface InvokeInsn
        Returns:
        The owner interface internal name.
      • toString

        public String toString()
        Returns a string representation of the instruction.
        Overrides:
        toString in class Instruction
        Returns:
        The mnemonic, method index, count, and resolved method.