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

Variable Index

 o cp
 o end
 o name
 o slot
 o start
 o type

Constructor Index

 o LocalVariableGen(int, String, ClassGenType, InstructionHandle, InstructionHandle)
Generate a local variable that with index `slot'.

Method Index

 o getEnd()
 o getLocalVariable(InstructionList, ConstantPoolGen)
Get LocalVariable object.
 o getName()
 o getSlot()
 o getStart()
 o getType()
 o setEnd(InstructionHandle)
 o setName(String)
 o setSlot(int)
 o setStart(InstructionHandle)
 o setType(ClassGenType)

Variables

 o slot
 private int slot
 o name
 private String name
 o type
 private ClassGenType type
 o start
 private InstructionHandle start
 o end
 private InstructionHandle end
 o cp
 private ConstantPoolGen cp

Constructors

 o 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)

Methods

 o 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
 o setSlot
 public void setSlot(int slot)
 o getSlot
 public int getSlot()
 o setName
 public void setName(String name)
 o getName
 public String getName()
 o setType
 public void setType(ClassGenType type)
 o getType
 public ClassGenType getType()
 o setStart
 public void setStart(InstructionHandle start)
 o setEnd
 public void setEnd(InstructionHandle end)
 o getStart
 public InstructionHandle getStart()
 o getEnd
 public InstructionHandle getEnd()

All Packages  Class Hierarchy  This Package  Previous  Next  Index