Package com.tonic.analysis.instruction
Class InvokeInterfaceInstruction
- java.lang.Object
-
- com.tonic.analysis.instruction.Instruction
-
- com.tonic.analysis.instruction.InvokeInterfaceInstruction
-
- All Implemented Interfaces:
InvokeInsn
public class InvokeInterfaceInstruction extends Instruction implements InvokeInsn
Represents the INVOKEINTERFACE instruction (0xB9).
-
-
Constructor Summary
Constructors Constructor Description InvokeInterfaceInstruction(ConstPool constPool, int opcode, int offset, int methodIndex, int count)Constructs an InvokeInterfaceInstruction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(AbstractBytecodeVisitor visitor)Accepts a visitor for bytecode analysis.intgetCount()intgetLocalChange()Returns the change in local variables caused by this instruction.StringgetMethodDescriptor()Returns the method descriptor.intgetMethodIndex()StringgetMethodName()Returns the method name.StringgetOwnerClass()Returns the owner interface name.intgetStackChange()Returns the change in stack size caused by this instruction.StringresolveMethod()Resolves and returns a string representation of the interface method.StringtoString()Returns a string representation of the instruction.voidwrite(DataOutputStream dos)Writes the INVOKEINTERFACE opcode and its operands to the DataOutputStream.-
Methods inherited from class com.tonic.analysis.instruction.Instruction
getLength, getOffset, getOpcode, setOffset
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tonic.analysis.instruction.InvokeInsn
isInterface, isStatic
-
-
-
-
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
-
accept
public void accept(AbstractBytecodeVisitor visitor)
Description copied from class:InstructionAccepts a visitor for bytecode analysis.- Specified by:
acceptin classInstruction- Parameters:
visitor- The visitor to accept.
-
write
public void write(DataOutputStream dos) throws IOException
Writes the INVOKEINTERFACE opcode and its operands to the DataOutputStream.- Specified by:
writein classInstruction- 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:
getStackChangein classInstruction- 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:
getLocalChangein classInstruction- 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:
getMethodNamein interfaceInvokeInsn- Returns:
- The method name.
-
getMethodDescriptor
public String getMethodDescriptor()
Returns the method descriptor.- Specified by:
getMethodDescriptorin interfaceInvokeInsn- Returns:
- The method descriptor.
-
getOwnerClass
public String getOwnerClass()
Returns the owner interface name.- Specified by:
getOwnerClassin interfaceInvokeInsn- Returns:
- The owner interface internal name.
-
toString
public String toString()
Returns a string representation of the instruction.- Overrides:
toStringin classInstruction- Returns:
- The mnemonic, method index, count, and resolved method.
-
-