org.apache.bcel.verifier.statics

Class LocalVariableInfo


public class LocalVariableInfo
extends java.lang.Object

A utility class holding the information about the name and the type of a local variable in a given slot (== index). This information often changes in course of byte code offsets.
Version:
$Id: LocalVariableInfo.java,v 1.2 2002/06/13 09:32:50 enver Exp $
Author:
Enver Haase

Method Summary

void
add(String name, int startpc, int length, Type t)
Adds some information about this local variable (slot).
String
getName(int offset)
Returns the name of the local variable that uses this local variable slot at the given bytecode offset.
Type
getType(int offset)
Returns the type of the local variable that uses this local variable slot at the given bytecode offset.

Method Details

add

public void add(String name,
                int startpc,
                int length,
                Type t)
            throws LocalVariableInfoInconsistentException
Adds some information about this local variable (slot).
Throws:
LocalVariableInfoInconsistentException - if the new information conflicts with already gathered information.

getName

public String getName(int offset)
Returns the name of the local variable that uses this local variable slot at the given bytecode offset. Care for legal bytecode offsets yourself, otherwise the return value might be wrong. May return 'null' if nothing is known about the type of this local variable slot at the given bytecode offset.

getType

public Type getType(int offset)
Returns the type of the local variable that uses this local variable slot at the given bytecode offset. Care for legal bytecode offsets yourself, otherwise the return value might be wrong. May return 'null' if nothing is known about the type of this local variable slot at the given bytecode offset.