org.apache.bcel.generic

Class InvokeInstruction

Implemented Interfaces:
Cloneable, ExceptionThrower, IndexedInstruction, LoadClass, Serializable, StackConsumer, StackProducer, TypedInstruction
Known Direct Subclasses:
INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL

public abstract class InvokeInstruction
extends FieldOrMethod
implements ExceptionThrower, TypedInstruction, StackConsumer, StackProducer

Super class for the INVOKExxx family of instructions.

Version:
$Id: InvokeInstruction.java,v 1.1.1.1 2001/10/29 20:00:20 jvanzyl Exp $

Author:
M. Dahm

Field Summary

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

index

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

length, opcode

Constructor Summary

InvokeInstruction(short opcode, int index)

Method Summary

int
consumeStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
Type[]
getArgumentTypes(ConstantPoolGen cpg)
String
getMethodName(ConstantPoolGen cpg)
Type
getReturnType(ConstantPoolGen cpg)
Type
getType(ConstantPoolGen cpg)
int
produceStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
String
toString(ConstantPool cp)

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

getClassName, getClassType, getLoadClassType, getName, 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, consumeStack, copy, dump, equals, getComparator, getLength, getName, getOpcode, initFromFile, produceStack, readInstruction, setComparator, toString, toString, toString

Constructor Details

InvokeInstruction

protected InvokeInstruction(short opcode,
                            int index)

Parameters:
index - to constant pool

Method Details

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 Instruction

Returns:
Number of words consumed from stack by this instruction


getArgumentTypes

public Type[] getArgumentTypes(ConstantPoolGen cpg)

Returns:
argument types of referenced method.


getMethodName

public String getMethodName(ConstantPoolGen cpg)

Returns:
name of referenced method.


getReturnType

public Type getReturnType(ConstantPoolGen cpg)

Returns:
return type of referenced method.


getType

public Type getType(ConstantPoolGen cpg)
Specified by:
getType in interface TypedInstruction
getType in interface LoadClass
Overrides:
getType in interface CPInstruction

Returns:
return type of referenced method.


produceStack

public int produceStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
Specified by:
produceStack in interface StackProducer
Overrides:
produceStack in interface Instruction

Returns:
Number of words produced onto stack by this instruction


toString

public String toString(ConstantPool cp)
Overrides:
toString in interface CPInstruction

Returns:
mnemonic for instruction with symbolic references resolved