org.apache.bcel.generic

Class InvokeInstruction

Implemented Interfaces:
Cloneable, ExceptionThrower, Node, java.io.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
See Also:
Serialized Form

Field Summary

Fields inherited from class org.apache.bcel.classfile.FieldOrMethod

attributes, attributes_count, constant_pool, name_index, signature_index

Fields inherited from class org.apache.bcel.classfile.AccessFlags

access_flags

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.classfile.FieldOrMethod

copy_, dump, getAttributes, getConstantPool, getName, getNameIndex, getSignature, getSignatureIndex, setAttributes, setConstantPool, setNameIndex, setSignatureIndex

Methods inherited from class org.apache.bcel.classfile.AccessFlags

getAccessFlags, getModifiers, isAbstract, isAbstract, isFinal, isFinal, isInterface, isInterface, isNative, isNative, isPrivate, isPrivate, isProtected, isProtected, isPublic, isPublic, isStatic, isStatic, isStrictfp, isStrictfp, isSynchronized, isSynchronized, isTransient, isTransient, isVolatile, isVolatile, setAccessFlags, setModifiers

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
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
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
Returns:
Number of words produced onto stack by this instruction

toString

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