NEWARRAYpublic class NEWARRAY extends Instruction implements ExceptionThrower, StackProducer, AllocationInstructionNEWARRAY - Create new array of basic type (int, short, ...)
Stack: ..., count -> ..., arrayref
type must be one of T_INT, T_SHORT, ... |
Fields Summary |
---|
private byte | type |
Constructors Summary |
---|
NEWARRAY()Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction(). Not to be used otherwise.
| public NEWARRAY(byte type)
super(com.sun.org.apache.bcel.internal.Constants.NEWARRAY, (short)2);
this.type = type;
| public NEWARRAY(BasicType type)
this(type.getType());
|
Methods Summary |
---|
public void | accept(com.sun.org.apache.bcel.internal.generic.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.
v.visitAllocationInstruction(this);
v.visitExceptionThrower(this);
v.visitStackProducer(this);
v.visitNEWARRAY(this);
| public void | dump(java.io.DataOutputStream out)Dump instruction as byte code to stream out.
out.writeByte(opcode);
out.writeByte(type);
| public java.lang.Class[] | getExceptions()
return new Class[] { com.sun.org.apache.bcel.internal.ExceptionConstants.NEGATIVE_ARRAY_SIZE_EXCEPTION };
| public final com.sun.org.apache.bcel.internal.generic.Type | getType()
return new ArrayType(BasicType.getType(type), 1);
| public final byte | getTypecode() return type;
| protected void | initFromFile(com.sun.org.apache.bcel.internal.util.ByteSequence bytes, boolean wide)Read needed data (e.g. index) from file.
type = bytes.readByte();
length = 2;
| public java.lang.String | toString(boolean verbose)
return super.toString(verbose) + " " + com.sun.org.apache.bcel.internal.Constants.TYPE_NAMES[type];
|
|