org.apache.bcel.classfile

Class AbstractLocalVariableTable

public abstract class AbstractLocalVariableTable extends Attribute

This class represents colection of local variables in a method. This attribute is contained in the Code attribute.

See Also: Code LocalVariable

Constructor Summary
AbstractLocalVariableTable(AbstractLocalVariableTable c)
Initialize from another object.
AbstractLocalVariableTable(int name_index, int length, LocalVariable[] local_variable_table, ConstantPool constant_pool)
Method Summary
Attributecopy(ConstantPool _constant_pool)
voiddump(DataOutputStream file)
Dump local variable table attribute to file stream in binary format.
LocalVariablegetLocalVariable(int index)
LocalVariablegetLocalVariable(int index, int pc)
LocalVariable[]getLocalVariableTable()
intgetTableLength()
voidsetLocalVariableTable(LocalVariable[] local_variable_table)
StringtoString()

Constructor Detail

AbstractLocalVariableTable

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

AbstractLocalVariableTable

public AbstractLocalVariableTable(int name_index, int length, LocalVariable[] local_variable_table, ConstantPool constant_pool)

Parameters: name_index Index in constant pool to `LocalVariableTable' length Content length in bytes local_variable_table Table of local variables constant_pool Array of constants

Method Detail

copy

public Attribute copy(ConstantPool _constant_pool)

Returns: deep copy of this attribute

dump

public final void dump(DataOutputStream file)
Dump local variable table attribute to file stream in binary format.

Parameters: file Output file stream

Throws: IOException

getLocalVariable

public final LocalVariable getLocalVariable(int index)

Deprecated: since 5.2 because multiple variables can share the same slot, use getLocalVariable(int index, int pc) instead.

Parameters: index the variable slot

Returns: first matching variable using index the first LocalVariable that matches the slot or null if not found

getLocalVariable

public final LocalVariable getLocalVariable(int index, int pc)

Parameters: index the variable slot pc the current pc that this variable is alive

Returns: matching variable using index when variable is used at supplied pc the LocalVariable that matches or null if not found

getLocalVariableTable

public final LocalVariable[] getLocalVariableTable()

Returns: Array of local variables of method.

getTableLength

public final int getTableLength()

setLocalVariableTable

public final void setLocalVariableTable(LocalVariable[] local_variable_table)

toString

public final String toString()

Returns: String representation.