org.apache.bcel.generic
Class LocalVariableInstruction
- java.lang.Object
-
- org.apache.bcel.generic.Instruction
-
- org.apache.bcel.generic.LocalVariableInstruction
-
- All Implemented Interfaces:
- java.lang.Cloneable, IndexedInstruction, TypedInstruction
- Direct Known Subclasses:
- IINC, LoadInstruction, StoreInstruction
public abstract class LocalVariableInstruction extends Instruction implements TypedInstruction, IndexedInstruction
Abstract super class for instructions dealing with local variables.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddump(java.io.DataOutputStream out)Dump instruction as byte code to stream out.shortgetCanonicalTag()intgetIndex()TypegetType(ConstantPoolGen cp)Returns the type associated with the instruction - in case of ALOAD or ASTORE Type.OBJECT is returned.voidsetIndex(int n)Set the local variable index.java.lang.StringtoString(boolean verbose)Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< local variable index>">"-
Methods inherited from class org.apache.bcel.generic.Instruction
accept, consumeStack, copy, equals, getComparator, getLength, getName, getOpcode, hashCode, isValidByte, isValidShort, produceStack, readInstruction, setComparator, toString, toString
-
-
-
-
Method Detail
-
dump
public void dump(java.io.DataOutputStream out) throws java.io.IOExceptionDump instruction as byte code to stream out.- Overrides:
dumpin classInstruction- Parameters:
out- Output stream- Throws:
java.io.IOException
-
toString
public java.lang.String toString(boolean verbose)
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")" "<"< local variable index>">"- Overrides:
toStringin classInstruction- Parameters:
verbose- long/short format switch- Returns:
- mnemonic for instruction
-
getIndex
public final int getIndex()
- Specified by:
getIndexin interfaceIndexedInstruction- Returns:
- local variable index (n) referred by this instruction.
-
setIndex
public void setIndex(int n)
Set the local variable index. also updates opcode and length TODO Why?- Specified by:
setIndexin interfaceIndexedInstruction- See Also:
setIndexOnly(int)
-
getCanonicalTag
public short getCanonicalTag()
- Returns:
- 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 .- Specified by:
getTypein interfaceTypedInstruction- Returns:
- type associated with the instruction
-
-
DataMelt 3.0 © DataMelt by jWork.ORG