All Packages Class Hierarchy This Package Previous Next Index
Class DE.fub.inf.JVM.JavaClass.LocalVariable
java.lang.Object
|
+----DE.fub.inf.JVM.JavaClass.LocalVariable
- public final class LocalVariable
- extends Object
- implements Constants
This class represents a local variable within a method. It contains its
scope, name, signature and index on the method's frame.
- Version:
- 970922
- Author:
- M. Dahm
- See Also:
- LocalVariableTable
-
LocalVariable()
- Empty constructor, all attributes have to be defined via `setXXX'
methods.
-
LocalVariable(LocalVariable)
- Initialize from another object.
-
LocalVariable(short, short, short, short, short, ConstantPool)
-
-
accept(Visitor)
- Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class.
-
dump(DataOutputStream)
- Dump local variable to file stream in binary format.
-
getConstantPool()
-
-
getLength()
-
-
getName()
-
-
getNameIndex()
-
-
getSignature()
-
-
getSignatureIndex()
-
-
getSlot()
-
-
getStartPC()
-
-
setConstantPool(ConstantPool)
-
-
setLength(short)
-
-
setNameIndex(short)
-
-
setSignatureIndex(short)
-
-
setSlot(short)
-
-
setStartPC(short)
-
-
toString()
-
LocalVariable
public LocalVariable()
- Empty constructor, all attributes have to be defined via `setXXX'
methods. Use at your own risk.
LocalVariable
public LocalVariable(LocalVariable c)
- Initialize from another object. Note that both objects use the same
references (shallow copy). Use clone() for a physical copy.
LocalVariable
public LocalVariable(short start_pc,
short length,
short name_index,
short signature_index,
short slot,
ConstantPool constant_pool)
- Parameters:
- start_pc - Range in which the variable
- length - ... is valid
- name_index - Index in constant pool of variable name
- signature_index - Index of variable's signature
- slot - Variable is `slot'th local variable on the method's frame
- constant_pool - Array of constants
accept
public void accept(Visitor v)
- Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. I.e., the hierarchy of methods,
fields, attributes, etc. spawns a tree of objects.
- Parameters:
- v - Visitor object
dump
public final void dump(DataOutputStream file) throws IOException
- Dump local variable to file stream in binary format.
- Parameters:
- file - Output file stream
getConstantPool
public final ConstantPool getConstantPool()
- Returns:
- Constant pool used by this object.
- See Also:
- ConstantPool
getLength
public final short getLength()
- Returns:
- Variable is valid within getStartPC() .. getStartPC()+getLength()
getName
public final String getName()
- Returns:
- Variable name.
getNameIndex
public final short getNameIndex()
- Returns:
- Index in constant pool of variable name.
getSignature
public final String getSignature()
- Returns:
- Signature.
getSignatureIndex
public final short getSignatureIndex()
- Returns:
- Index in constant pool of variable signature.
getSlot
public final short getSlot()
- Returns:
- Variable is `getSlot()'th local variable on this method's frame.
getStartPC
public final short getStartPC()
- Returns:
- Start of range where he variable is valid
setConstantPool
public final void setConstantPool(ConstantPool constant_pool)
- Parameters:
- constant_pool - Constant pool to be used for this object.
- See Also:
- ConstantPool
setLength
public final void setLength(short length)
setNameIndex
public final void setNameIndex(short name_index)
setSignatureIndex
public final void setSignatureIndex(short signature_index)
setSlot
public final void setSlot(short slot)
setStartPC
public final void setStartPC(short start_pc)
- Parameters:
- start_pc - Specify range where the local variable is valid.
toString
public final String toString()
- Returns:
- Resolved string representation.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index