org.apache.bcel.generic

Class INVOKEINTERFACE

Implemented Interfaces:
Cloneable, ExceptionThrower, IndexedInstruction, LoadClass, Serializable, StackConsumer, StackProducer, TypedInstruction

public final class INVOKEINTERFACE
extends InvokeInstruction

INVOKEINTERFACE - Invoke interface method
Stack: ..., objectref, [arg1, [arg2 ...]] -> ...
Version:
$Id: INVOKEINTERFACE.java 386056 2006-03-15 11:31:56Z tcurdt $
Author:
M. Dahm

Field Summary

private int
nargs

Fields inherited from class org.apache.bcel.generic.CPInstruction

index

Fields inherited from class org.apache.bcel.generic.Instruction

cmp, length, opcode

Constructor Summary

INVOKEINTERFACE()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction().
INVOKEINTERFACE(int index, int nargs)

Method Summary

void
accept(Visitor v)
Call corresponding visitor method(s).
int
consumeStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
void
dump(DataOutputStream out)
Dump instruction as byte code to stream out.
int
getCount()
The count argument according to the Java Language Specification, Second Edition.
Class[]
getExceptions()
protected void
initFromFile(ByteSequence bytes, boolean wide)
Read needed data (i.e., index) from file.
String
toString(ConstantPool cp)

Methods inherited from class org.apache.bcel.generic.InvokeInstruction

consumeStack, getArgumentTypes, getMethodName, getReturnType, getType, produceStack, toString

Methods inherited from class org.apache.bcel.generic.FieldOrMethod

getClassName, getClassType, getLoadClassType, getName, getReferenceType, getSignature

Methods inherited from class org.apache.bcel.generic.CPInstruction

dump, getIndex, getType, initFromFile, setIndex, toString, toString

Methods inherited from class org.apache.bcel.generic.Instruction

accept, className, consumeStack, copy, dispose, dump, equals, getComparator, getLength, getName, getOpcode, initFromFile, produceStack, readInstruction, setComparator, setOpcode, toString, toString, toString

Field Details

nargs

private int nargs

Constructor Details

INVOKEINTERFACE

(package private)  INVOKEINTERFACE()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise.

INVOKEINTERFACE

public INVOKEINTERFACE(int index,
                       int nargs)

Method Details

accept

public void accept(Visitor v)
Call corresponding visitor method(s). The order is: Call visitor methods of implemented interfaces first, then call methods according to the class hierarchy in descending order, i.e., the most specific visitXXX() call comes last.
Overrides:
accept in interface Instruction
Parameters:
v - Visitor object

consumeStack

public int consumeStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
Specified by:
consumeStack in interface StackConsumer
Overrides:
consumeStack in interface InvokeInstruction
Returns:
Number of words consumed from stack by this instruction

dump

public void dump(DataOutputStream out)
            throws IOException
Dump instruction as byte code to stream out.
Overrides:
dump in interface CPInstruction
Parameters:
out - Output stream

getCount

public int getCount()
The count argument according to the Java Language Specification, Second Edition.

getExceptions

public Class[] getExceptions()
Specified by:
getExceptions in interface ExceptionThrower

initFromFile

protected void initFromFile(ByteSequence bytes,
                            boolean wide)
            throws IOException
Read needed data (i.e., index) from file.
Overrides:
initFromFile in interface CPInstruction

toString

public String toString(ConstantPool cp)
Overrides:
toString in interface InvokeInstruction
Returns:
mnemonic for instruction with symbolic references resolved