Top Description Fields Constructors Methods
org.apache.bcel.generic

public Class NEWARRAY

extends Instruction
implements AllocationInstruction, ExceptionThrower, StackProducer
Class Inheritance
All Implemented Interfaces
org.apache.bcel.generic.StackProducer, org.apache.bcel.generic.ExceptionThrower, org.apache.bcel.generic.AllocationInstruction
Imports
java.io.DataOutputStream, .IOException, org.apache.bcel.ExceptionConst, org.apache.bcel.util.ByteSequence

NEWARRAY - Create new array of basic type (int, short, ...)
Stack: ..., count -> ..., arrayref
type must be one of T_INT, T_SHORT, ...

Field Summary

Modifier and TypeField and Description
private byte
Inherited from org.apache.bcel.generic.Instruction:
EMPTY_ARRAYlengthopcode

Constructor Summary

AccessConstructor and Description
pack-priv
NEWARRAY()

Empty constructor needed for Instruction.readInstruction.

public
NEWARRAY(final BasicType type)

public
NEWARRAY(final byte type)

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements abstract org.apache.bcel.generic.Instruction.accept.

Call corresponding visitor method(s).
public void
dump(final DataOutputStream
Output stream
out
)

Overrides org.apache.bcel.generic.Instruction.dump.

Dump instruction as byte code to stream out.
public Class<?>[]
public final Type

Returns:

type of constructed array
getType
()

public final byte

Returns:

numeric code for basic element type
getTypecode
()

protected void
initFromFile(final ByteSequence
byte sequence to read from
bytes
,
final boolean
"wide" instruction flag
wide
)

Overrides org.apache.bcel.generic.Instruction.initFromFile.

Read needed data (e.g. index) from file.
public String

Returns:

mnemonic for instruction
toString
(final boolean
long/short format switch
verbose
)

Overrides org.apache.bcel.generic.Instruction.toString.

Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")"
Inherited from org.apache.bcel.generic.Instruction:
consumeStackcopydisposeequalsgetComparatorgetLengthgetNamegetOpcodehashCodeisValidByteisValidShortproduceStackreadInstructionsetComparatorsetLengthsetOpcodetoStringtoString

Field Detail

typeback to summary
private byte type

Constructor Detail

NEWARRAYback to summary
pack-priv NEWARRAY()

Empty constructor needed for Instruction.readInstruction. Not to be used otherwise.

NEWARRAYback to summary
public NEWARRAY(final BasicType type)
NEWARRAYback to summary
public NEWARRAY(final byte type)

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract org.apache.bcel.generic.Instruction.accept.

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.

Parameters
v:Visitor

Visitor object

Annotations
@Override
dumpback to summary
public void dump(final DataOutputStream out) throws IOException

Overrides org.apache.bcel.generic.Instruction.dump.

Dump instruction as byte code to stream out.

Parameters
out:DataOutputStream

Output stream

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.bcel.generic.Instruction.dump.

Thrown when an I/O exception of some sort has occurred.

getExceptionsback to summary
public Class<?>[] getExceptions()

Implements org.apache.bcel.generic.ExceptionThrower.getExceptions.

Annotations
@Override
getTypeback to summary
public final Type getType()
Returns:Type

type of constructed array

getTypecodeback to summary
public final byte getTypecode()
Returns:byte

numeric code for basic element type

initFromFileback to summary
protected void initFromFile(final ByteSequence bytes, final boolean wide) throws IOException

Overrides org.apache.bcel.generic.Instruction.initFromFile.

Read needed data (e.g. index) from file.

Parameters
bytes:ByteSequence

Doc from org.apache.bcel.generic.Instruction.initFromFile.

byte sequence to read from

wide:boolean

Doc from org.apache.bcel.generic.Instruction.initFromFile.

"wide" instruction flag

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.bcel.generic.Instruction.initFromFile.

may be thrown if the implementation needs to read data from the file

toStringback to summary
public String toString(final boolean verbose)

Overrides org.apache.bcel.generic.Instruction.toString.

Doc from org.apache.bcel.generic.Instruction.toString.

Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")"

Parameters
verbose:boolean

long/short format switch

Returns:String

mnemonic for instruction

Annotations
@Override