All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.fub.bytecode.classfile.LocalVariable

java.lang.Object
   |
   +----de.fub.bytecode.classfile.LocalVariable

public final class LocalVariable
extends Object
implements Constants, Cloneable
This class represents a local variable within a method. It contains its scope, name, signature and index on the method's frame.

Version:
$Id: LocalVariable.java,v 1.5 1999/06/08 16:59:22 dahm Exp $
Author:
M. Dahm
See Also:
LocalVariableTable

Constructor Index

 o LocalVariable(int, int, int, int, int, ConstantPool)
 o LocalVariable(LocalVariable)
Initialize from another object.

Method Index

 o accept(Visitor)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
 o copy()
 o dump(DataOutputStream)
Dump local variable to file stream in binary format.
 o getConstantPool()
 o getIndex()
 o getLength()
 o getName()
 o getNameIndex()
 o getSignature()
 o getSignatureIndex()
 o getStartPC()
 o setConstantPool(ConstantPool)
 o setIndex(int)
 o setLength(int)
 o setNameIndex(int)
 o setSignatureIndex(int)
 o setStartPC(int)
 o toString()

Constructors

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

 o LocalVariable
 public LocalVariable(int start_pc,
                      int length,
                      int name_index,
                      int signature_index,
                      int index,
                      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
index - Variable is `index'th local variable on the method's frame
constant_pool - Array of constants

Methods

 o 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
 o dump
 public final void dump(DataOutputStream file) throws IOException
Dump local variable to file stream in binary format.

Parameters:
file - Output file stream
 o getConstantPool
 public final ConstantPool getConstantPool()
Returns:
Constant pool used by this object.
See Also:
ConstantPool
 o getLength
 public final int getLength()
Returns:
Variable is valid within getStartPC() .. getStartPC()+getLength()
 o getName
 public final String getName()
Returns:
Variable name.
 o getNameIndex
 public final int getNameIndex()
Returns:
Index in constant pool of variable name.
 o getSignature
 public final String getSignature()
Returns:
Signature.
 o getSignatureIndex
 public final int getSignatureIndex()
Returns:
Index in constant pool of variable signature.
 o getIndex
 public final int getIndex()
Returns:
Variable is `getIndex()'th local variable on this method's frame.
 o getStartPC
 public final int getStartPC()
Returns:
Start of range where he variable is valid
 o setConstantPool
 public final void setConstantPool(ConstantPool constant_pool)
Parameters:
constant_pool - Constant pool to be used for this object.
See Also:
ConstantPool
 o setLength
 public final void setLength(int length)
 o setNameIndex
 public final void setNameIndex(int name_index)
 o setSignatureIndex
 public final void setSignatureIndex(int signature_index)
 o setIndex
 public final void setIndex(int index)
 o setStartPC
 public final void setStartPC(int start_pc)
Parameters:
start_pc - Specify range where the local variable is valid.
 o toString
 public final String toString()
Returns:
string representation.
Overrides:
toString in class Object
 o copy
 public LocalVariable copy()
Returns:
deep copy of this object

All Packages  Class Hierarchy  This Package  Previous  Next  Index