All Packages Class Hierarchy This Package Previous Next Index
Class espresso.classfile.classgen.LocalVariableGen
java.lang.Object
|
+----espresso.classfile.classgen.LocalVariableGen
- public final class LocalVariableGen
- extends Object
- implements Constants
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.
- See Also:
- LocalVariable, Instruction, MethodGen
-
cp
-
-
end
-
-
name
-
-
slot
-
-
start
-
-
type
-
-
LocalVariableGen(int, String, ClassGenType, InstructionHandle, InstructionHandle)
- Generate a local variable that with index `slot'.
-
getEnd()
-
-
getLocalVariable(InstructionList, ConstantPoolGen)
- Get LocalVariable object.
-
getName()
-
-
getSlot()
-
-
getStart()
-
-
getType()
-
-
setEnd(InstructionHandle)
-
-
setName(String)
-
-
setSlot(int)
-
-
setStart(InstructionHandle)
-
-
setType(ClassGenType)
-
slot
private int slot
name
private String name
type
private ClassGenType type
start
private InstructionHandle start
end
private InstructionHandle end
cp
private ConstantPoolGen cp
LocalVariableGen
public LocalVariableGen(int slot,
String name,
ClassGenType type,
InstructionHandle start,
InstructionHandle end)
- Generate a local variable that with index `slot'. Note that double and long
variables need two slots. Slot indices have to be provided by the user.
- Parameters:
- slot - index of local variable
- name - its name
- type - its type
- start - from where the instruction is valid (null means from the start)
- end - until where the instruction is valid (null means to the end)
getLocalVariable
public LocalVariable getLocalVariable(InstructionList il,
ConstantPoolGen cp)
- Get LocalVariable object. If `start' is null it is set to the start of the method,
accordingly `end' points to the end of the instruction list if it was null.
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.
- Parameters:
- il - instruction list (byte code) which this variable belongs to
- cp - constant pool
setSlot
public void setSlot(int slot)
getSlot
public int getSlot()
setName
public void setName(String name)
getName
public String getName()
setType
public void setType(ClassGenType type)
getType
public ClassGenType getType()
setStart
public void setStart(InstructionHandle start)
setEnd
public void setEnd(InstructionHandle end)
getStart
public InstructionHandle getStart()
getEnd
public InstructionHandle getEnd()
All Packages Class Hierarchy This Package Previous Next Index