APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.generic

public Class NEWARRAY

extends Instruction
implements AllocationInstruction, ExceptionThrower, StackProducer
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.bcel.internal.generic.StackProducer, com.sun.org.apache.bcel.internal.generic.ExceptionThrower, com.sun.org.apache.bcel.internal.generic.AllocationInstruction
Imports
java.io.DataOutputStream, .IOException, com.sun.org.apache.bcel.internal.ExceptionConst, com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.generic.Instruction.accept.

Call corresponding visitor method(s).

public void
dump(final DataOutputStream
Output stream
out
)

Overrides com.sun.org.apache.bcel.internal.generic.Instruction.dump.

Dump instruction as byte code to stream out.

public Class<?>[]
public final Type
getType()

Returns: type of constructed array

public final byte
getTypecode()

Returns: numeric code for basic element type

protected void
initFromFile(final ByteSequence bytes, final boolean wide)

Overrides com.sun.org.apache.bcel.internal.generic.Instruction.initFromFile.

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

public String

Returns:

mnemonic for instruction
toString
(final boolean verbose)

Overrides com.sun.org.apache.bcel.internal.generic.Instruction.toString.

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

Inherited from com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.generic.Instruction.dump.

Dump instruction as byte code to stream out.

Parameters
out:DataOutputStream

Output stream

Annotations
@Override
Exceptions
IOException:

Doc from com.sun.org.apache.bcel.internal.generic.Instruction.dump.

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

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

Implements com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.generic.Instruction.initFromFile.

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

Annotations
@Override
Exceptions
IOException:

Doc from com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.generic.Instruction.toString.

Doc from com.sun.org.apache.bcel.internal.generic.Instruction.toString.

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

Returns:String

mnemonic for instruction

Annotations
@Override