Class DE.fub.inf.JVM.ClassGen.LocalVariableGen
java.lang.Object
|
+--DE.fub.inf.JVM.ClassGen.LocalVariableGen
- public final class LocalVariableGen
- extends java.lang.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.
- Version:
- $Id: LocalVariableGen.java,v 1.2 1998/08/05 15:13:26 dahm Exp $
- Author:
- M. Dahm
- See Also:
- LocalVariable, MethodGen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
LocalVariableGen
public LocalVariableGen(int slot,
java.lang.String name,
Type 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(ConstantPoolGen cp)
- 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.
- 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(java.lang.String name)
getName
public java.lang.String getName()
setType
public void setType(Type type)
getType
public Type getType()
setStart
public void setStart(InstructionHandle start)
setEnd
public void setEnd(InstructionHandle end)
getStart
public InstructionHandle getStart()
getEnd
public InstructionHandle getEnd()
equals
public boolean equals(java.lang.Object o)
- We consider to local variables to be equal, if the use the same slot and
are valid in the same range.
- Overrides:
- equals in class java.lang.Object