org.apache.bcel.generic
Class LocalVariableInstruction
- Cloneable, IndexedInstruction, Serializable, TypedInstruction
public abstract class LocalVariableInstruction
Abstract super class for instructions dealing with local variables.
$Id: LocalVariableInstruction.java 152824 2002-08-07 18:01:32Z mdahm $
void | dump(DataOutputStream out)- Dump instruction as byte code to stream out.
|
short | getCanonicalTag()
|
int | getIndex()
|
Type | getType(ConstantPoolGen cp)- Returns the type associated with the instruction -
in case of ALOAD or ASTORE Type.OBJECT is returned.
|
protected void | initFromFile(ByteSequence bytes, boolean wide)- Read needed data (e.g.
|
void | setIndex(int n)- Set the local variable index
|
String | toString(boolean verbose)- Long output format:
<name of opcode> "["<opcode number>"]"
"("<length of instruction>")" "<"< local variable index>">"
|
accept, consumeStack, copy, dump, equals, getComparator, getLength, getName, getOpcode, initFromFile, produceStack, readInstruction, setComparator, toString, toString, toString |
LocalVariableInstruction
protected LocalVariableInstruction(short opcode,
short c_tag,
int n)opcode - Instruction opcodec_tag - Instruction number for compact version, ALOAD_0, e.g.n - local variable index (unsigned short)
dump
public void dump(DataOutputStream out)
throws IOException Dump instruction as byte code to stream out.
- dump in interface Instruction
getCanonicalTag
public short getCanonicalTag()
- canonical tag for instruction, e.g., ALOAD for ALOAD_0
getType
public Type getType(ConstantPoolGen cp)
Returns the type associated with the instruction -
in case of ALOAD or ASTORE Type.OBJECT is returned.
This is just a bit incorrect, because ALOAD and ASTORE
may work on every ReferenceType (including Type.NULL) and
ASTORE may even work on a ReturnaddressType .
- getType in interface TypedInstruction
- type associated with the instruction
initFromFile
protected void initFromFile(ByteSequence bytes,
boolean wide)
throws IOException Read needed data (e.g. index) from file.
PRE: (ILOAD <= tag <= ALOAD_3) || (ISTORE <= tag <= ASTORE_3)
- initFromFile in interface Instruction
toString
public String toString(boolean verbose)
Long output format:
<name of opcode> "["<opcode number>"]"
"("<length of instruction>")" "<"< local variable index>">"
- toString in interface Instruction
verbose - long/short format switch