org.apache.bcel.generic

Class MULTIANEWARRAY

Implemented Interfaces:
AllocationInstruction, Cloneable, ExceptionThrower, IndexedInstruction, LoadClass, Serializable, TypedInstruction

public class MULTIANEWARRAY
extends CPInstruction
implements LoadClass, AllocationInstruction, ExceptionThrower

MULTIANEWARRAY - Create new mutidimensional array of references
Stack: ..., count1, [count2, ...] -> ..., arrayref
Version:
$Id: MULTIANEWARRAY.java,v 1.1.1.1 2001/10/29 20:00:24 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

MULTIANEWARRAY(int index, short dimensions)

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.
short
getDimensions()
Class[]
getExceptions()
ObjectType
getLoadClassType(ConstantPoolGen cpg)
protected void
initFromFile(ByteSequence bytes, boolean wide)
Read needed data (i.e., no.
String
toString(boolean verbose)
String
toString(ConstantPool cp)

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

MULTIANEWARRAY

public MULTIANEWARRAY(int index,
                      short dimensions)

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.
Overrides:
consumeStack in interface Instruction
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

getDimensions

public final short getDimensions()
Returns:
number of dimensions to be created

getExceptions

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

getLoadClassType

public ObjectType getLoadClassType(ConstantPoolGen cpg)
Specified by:
getLoadClassType in interface LoadClass

initFromFile

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

toString

public String toString(boolean verbose)
Overrides:
toString in interface CPInstruction
Returns:
mnemonic for instruction

toString

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