Top Description Fields Constructors Methods
org.aspectj.apache.bcel.classfile

public final Class LocalVariable

extends Object
implements Constants, Cloneable, Node
Class Inheritance
All Implemented Interfaces
org.aspectj.apache.bcel.classfile.Node, java.lang.Cloneable, org.aspectj.apache.bcel.Constants
Imports
java.io.DataInputStream, .DataOutputStream, .IOException, org.aspectj.apache.bcel.Constants

This class represents a local variable within a method. It contains its scope, name, signature and index on the method's frame.
Author
M. Dahm
Version
$Id: LocalVariable.java,v 1.5 2009/09/10 15:35:05 aclement Exp $
See Also
LocalVariableTable

Field Summary

Modifier and TypeField and Description
private ConstantPool
private int
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
LocalVariable(LocalVariable c)

Initialize from another object.

pack-priv
LocalVariable(DataInputStream
Input stream
file
,
ConstantPool constant_pool)

Construct object from file stream.

public
LocalVariable(int
Range in which the variable
start_pc
,
int
... is valid
length
,
int
Index in constant pool of variable name
name_index
,
int
Index of variable's signature
signature_index
,
int
Variable is `index'th local variable on the method's frame
index
,
ConstantPool
Array of constants
constant_pool
)

Method Summary

Modifier and TypeMethod and Description
public void
accept(ClassVisitor
Visitor object
v
)

Implements org.aspectj.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
public LocalVariable

Returns:

deep copy of this object
copy
()

public final void
dump(DataOutputStream
Output file stream
file
)

Dump local variable to file stream in binary format.

public final ConstantPool

Returns:

Constant pool used by this object.
getConstantPool
()

public final int

Returns:

index of register where variable is stored
getIndex
()

public final int

Returns:

Variable is valid within getStartPC() .. getStartPC()+getLength()
getLength
()

public final String

Returns:

Variable name.
getName
()

public final int

Returns:

Index in constant pool of variable name.
getNameIndex
()

public final String

Returns:

Signature.
getSignature
()

public final int

Returns:

Index in constant pool of variable signature.
getSignatureIndex
()

public final int

Returns:

Start of range where he variable is valid
getStartPC
()

public final void
setConstantPool(ConstantPool
Constant pool to be used for this object.
constant_pool
)

public final void
setIndex(int index)

public final void
setLength(int length)

public final void
setNameIndex(int name_index)

public final void
setSignatureIndex(int signature_index)

public final void
setStartPC(int
Specify range where the local variable is valid.
start_pc
)

public final String

Returns:

string representation.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

constant_poolback to summary
private ConstantPool constant_pool
indexback to summary
private int index
lengthback to summary
private int length
name_indexback to summary
private int name_index
signature_indexback to summary
private int signature_index
start_pcback to summary
private int start_pc

Constructor Detail

LocalVariableback to summary
public LocalVariable(LocalVariable c)

Initialize from another object. Note that both objects use the same references (shallow copy). Use copy() for a physical copy.

LocalVariableback to summary
pack-priv LocalVariable(DataInputStream file, ConstantPool constant_pool) throws IOException

Construct object from file stream.

Parameters
file:DataInputStream

Input stream

LocalVariableback to summary
public LocalVariable(int start_pc, int length, int name_index, int signature_index, int index, ConstantPool constant_pool)
Parameters
start_pc:int

Range in which the variable

length:int

... is valid

name_index:int

Index in constant pool of variable name

signature_index:int

Index of variable's signature

index:int

Variable is `index'th local variable on the method's frame

constant_pool:ConstantPool

Array of constants

Method Detail

acceptback to summary
public void accept(ClassVisitor v)

Implements org.aspectj.apache.bcel.classfile.Node.accept.

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:ClassVisitor

Visitor object

copyback to summary
public LocalVariable copy()
Returns:LocalVariable

deep copy of this object

dumpback to summary
public final void dump(DataOutputStream file) throws IOException

Dump local variable to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

getConstantPoolback to summary
public final ConstantPool getConstantPool()
Returns:ConstantPool

Constant pool used by this object.

getIndexback to summary
public final int getIndex()
Returns:int

index of register where variable is stored

getLengthback to summary
public final int getLength()
Returns:int

Variable is valid within getStartPC() .. getStartPC()+getLength()

getNameback to summary
public final String getName()
Returns:String

Variable name.

getNameIndexback to summary
public final int getNameIndex()
Returns:int

Index in constant pool of variable name.

getSignatureback to summary
public final String getSignature()
Returns:String

Signature.

getSignatureIndexback to summary
public final int getSignatureIndex()
Returns:int

Index in constant pool of variable signature.

getStartPCback to summary
public final int getStartPC()
Returns:int

Start of range where he variable is valid

setConstantPoolback to summary
public final void setConstantPool(ConstantPool constant_pool)
Parameters
constant_pool:ConstantPool

Constant pool to be used for this object.

setIndexback to summary
public final void setIndex(int index)
setLengthback to summary
public final void setLength(int length)
setNameIndexback to summary
public final void setNameIndex(int name_index)
setSignatureIndexback to summary
public final void setSignatureIndex(int signature_index)
setStartPCback to summary
public final void setStartPC(int start_pc)
Parameters
start_pc:int

Specify range where the local variable is valid.

toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

string representation.

Annotations
@Override