|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.bcel.generic.LocalVariableGen
public class LocalVariableGen
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.
LocalVariable
,
MethodGen
,
Serialized FormConstructor Summary | |
---|---|
LocalVariableGen(int index,
String name,
Type type,
InstructionHandle start,
InstructionHandle end)
Generate a local variable that with index `index'. |
Method Summary | |
---|---|
Object |
clone()
|
boolean |
containsTarget(InstructionHandle ih)
|
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. |
InstructionHandle |
getEnd()
|
int |
getIndex()
|
LocalVariable |
getLocalVariable(ConstantPoolGen cp)
Get LocalVariable object. |
String |
getName()
|
InstructionHandle |
getStart()
|
Type |
getType()
|
int |
hashCode()
|
void |
setEnd(InstructionHandle end)
|
void |
setIndex(int index)
|
void |
setName(String name)
|
void |
setStart(InstructionHandle start)
|
void |
setType(Type type)
|
String |
toString()
|
void |
updateTarget(InstructionHandle old_ih,
InstructionHandle new_ih)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LocalVariableGen(int index, String name, Type type, InstructionHandle start, InstructionHandle end)
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)Method Detail |
---|
public LocalVariable getLocalVariable(ConstantPoolGen cp)
cp
- constant poolpublic void setIndex(int index)
public int getIndex()
public void setName(String name)
setName
in interface NamedAndTyped
public String getName()
getName
in interface NamedAndTyped
public void setType(Type type)
setType
in interface NamedAndTyped
public Type getType()
getType
in interface NamedAndTyped
public InstructionHandle getStart()
public InstructionHandle getEnd()
public void setStart(InstructionHandle start)
public void setEnd(InstructionHandle end)
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih)
updateTarget
in interface InstructionTargeter
old_ih
- old target, either start or endnew_ih
- new targetpublic boolean containsTarget(InstructionHandle ih)
containsTarget
in interface InstructionTargeter
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public String toString()
toString
in class Object
public Object clone()
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |