Package org.aspectj.apache.bcel.generic
Klasse LocalVariableGen
java.lang.Object
org.aspectj.apache.bcel.generic.LocalVariableGen
- Alle implementierten Schnittstellen:
Serializable
,Cloneable
,InstructionTargeter
public class LocalVariableGen
extends Object
implements InstructionTargeter, Cloneable, Serializable
This class represents a local variable within a method. It contains its scope, name and type. The generated LocalVariable object
can be obtained with getLocalVariable which needs the instruction list and the constant pool as parameters.
- Version:
- $Id: LocalVariableGen.java,v 1.7 2008/08/28 00:04:23 aclement Exp $
- Autor:
- M. Dahm
- Siehe auch:
-
Konstruktorübersicht
KonstruktorBeschreibungLocalVariableGen
(int index, String name, Type type, InstructionHandle start, InstructionHandle end) Generate a local variable that with index `index'. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungclone()
boolean
boolean
We consider to local variables to be equal, if the use the same index and are valid in the same range.getEnd()
int
getIndex()
Get LocalVariable object.getName()
getStart()
getType()
void
setEnd
(InstructionHandle end) void
setIndex
(int index) void
void
setStart
(InstructionHandle start) void
toString()
void
updateTarget
(InstructionHandle old_ih, InstructionHandle new_ih)
-
Konstruktordetails
-
LocalVariableGen
public LocalVariableGen(int index, String name, Type type, InstructionHandle start, InstructionHandle end) Generate a local variable that with index `index'. Note that double and long variables need two indexs. Index indices have to be provided by the user.- Parameter:
index
- index of local variablename
- its nametype
- its typestart
- from where the instruction is valid (null means from the start)end
- until where the instruction is valid (null means to the end)
-
-
Methodendetails
-
getLocalVariable
Get LocalVariable object. This relies on that the instruction list has already been dumped to byte code or or that the `setPositions' methods has been called for the instruction list. Note that for local variables whose scope end at the last instruction of the method's code, the JVM specification is ambiguous: both a start_pc+length ending at the last instruction and start_pc+length ending at first index beyond the end of the code are valid.- Parameter:
cp
- constant poolil
- instruction list (byte code) which this variable belongs to
-
setIndex
public void setIndex(int index) -
getIndex
public int getIndex() -
setName
-
getName
-
setType
-
getType
-
getStart
-
getEnd
-
setStart
-
setEnd
-
updateTarget
- Angegeben von:
updateTarget
in SchnittstelleInstructionTargeter
- Parameter:
old_ih
- old target, either start or endnew_ih
- new target
-
containsTarget
- Angegeben von:
containsTarget
in SchnittstelleInstructionTargeter
- Gibt zurück:
- true, if ih is target of this variable
-
equals
We consider to local variables to be equal, if the use the same index and are valid in the same range. -
toString
-
clone
-