All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.fub.bytecode.generic.LocalVariableGen

java.lang.Object
   |
   +----de.fub.bytecode.generic.LocalVariableGen

public class LocalVariableGen
extends Object
implements Constants, InstructionTargeter
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.9 1999/08/30 13:54:43 dahm Exp $
Author:
M. Dahm
See Also:
LocalVariable, MethodGen

Constructor Index

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

Method Index

 o containsTarget(InstructionHandle)
 o equals(Object)
We consider to local variables to be equal, if the use the same index and are valid in the same range.
 o getEnd()
 o getIndex()
 o getLocalVariable(ConstantPoolGen)
Get LocalVariable object.
 o getName()
 o getSlot()
Deprecated.
 o getStart()
 o getType()
 o setEnd(InstructionHandle)
 o setIndex(int)
 o setName(String)
 o setSlot(int)
Deprecated.
 o setStart(InstructionHandle)
 o setType(Type)
 o toString()
 o updateTarget(InstructionHandle, InstructionHandle)

Constructors

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

Parameters:
index - 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(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
 o setIndex
 public void setIndex(int index)
 o getIndex
 public int getIndex()
 o setName
 public void setName(String name)
 o getName
 public String getName()
 o setType
 public void setType(Type type)
 o getType
 public Type getType()
 o getStart
 public InstructionHandle getStart()
 o getEnd
 public InstructionHandle getEnd()
 o setStart
 public void setStart(InstructionHandle start)
 o setEnd
 public void setEnd(InstructionHandle end)
 o updateTarget
 public void updateTarget(InstructionHandle old_ih,
                          InstructionHandle new_ih)
Parameters:
old_ih - old target, either start or end
new_ih - new target
 o containsTarget
 public boolean containsTarget(InstructionHandle ih)
Returns:
true, if ih is target of this variable
 o equals
 public boolean equals(Object o)
We consider to local variables to be equal, if the use the same index and are valid in the same range.

Overrides:
equals in class Object
 o toString
 public String toString()
Overrides:
toString in class Object
 o setSlot
 public void setSlot(int index)
Note: setSlot() is deprecated.

 o getSlot
 public int getSlot()
Note: getSlot() is deprecated.


All Packages  Class Hierarchy  This Package  Previous  Next  Index