FileDocCategorySizeDatePackage
LocalVariablesInfo.javaAPI DocJava SE 5 API5065Fri Aug 26 14:55:26 BST 2005com.sun.org.apache.bcel.internal.verifier.statics

LocalVariablesInfo

public class LocalVariablesInfo extends Object
A utility class holding the information about the names and the types of the local variables in a given method.
version
$Id: LocalVariablesInfo.java,v 1.1.1.1 2001/10/29 20:00:34 jvanzyl Exp $
author
Enver Haase

Fields Summary
private LocalVariableInfo[]
localVariableInfos
The information about the local variables is stored here.
private IntList
instruction_offsets
The ints in the list represent code offsets where either instructions must start or the offset is the length of the code array. This will be verified in Pass 3a.
Constructors Summary
LocalVariablesInfo(int max_locals)
The constructor.

	
	   
	 
		localVariableInfos = new LocalVariableInfo[max_locals];
		for (int i=0; i<max_locals; i++){
			localVariableInfos[i] = new LocalVariableInfo();
		}
	
Methods Summary
public voidadd(int slot, java.lang.String name, int startpc, int length, com.sun.org.apache.bcel.internal.generic.Type t)
Adds information about the local variable in slot 'slot'. Automatically adds information for slot+1 if 't' is Type.LONG or Type.DOUBLE.

throws
LocalVariableInfoInconsistentException if the new information conflicts with already gathered information.

		// The add operation on LocalVariableInfo may throw the '...Inconsistent...' exception, we don't throw it explicitely here.
		
		if (slot < 0 || slot >= localVariableInfos.length){
			throw new AssertionViolatedException("Slot number for local variable information out of range.");
		}

		localVariableInfos[slot].add(name, startpc, length, t);
		if (t == Type.LONG) localVariableInfos[slot+1].add(name, startpc, length, LONG_Upper.theInstance());
		if (t == Type.DOUBLE) localVariableInfos[slot+1].add(name, startpc, length, DOUBLE_Upper.theInstance());
	
public LocalVariableInfogetLocalVariableInfo(int slot)
Returns the LocalVariableInfo for the given slot.

		if (slot < 0 || slot >= localVariableInfos.length){
			throw new AssertionViolatedException("Slot number for local variable information out of range.");
		}
		return localVariableInfos[slot];