Class LocalVariables
- java.lang.Object
-
- org.apache.bcel.verifier.structurals.LocalVariables
-
- All Implemented Interfaces:
java.lang.Cloneable
public class LocalVariables extends java.lang.Object implements java.lang.CloneableThis class implements an array of local variables used for symbolic JVM simulation.
-
-
Constructor Summary
Constructors Constructor Description LocalVariables(int localVariableCount)Creates a new LocalVariables object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a deep copy of this object; i.e.booleanequals(java.lang.Object o)Typeget(int slotIndex)Returns the type of the local variable slot index.LocalVariablesgetClone()Returns a (correctly typed) clone of this object.inthashCode()voidinitializeObject(UninitializedObjectType uninitializedObjectType)Replaces all occurrences ofuninitializedObjectTypein this local variables set with an "initialized" ObjectType.intmaxLocals()Returns the number of local variable slots.voidmerge(LocalVariables localVariable)Merges two local variables sets as described in the Java Virtual Machine Specification, Second Edition, section 4.9.2, page 146.voidset(int slotIndex, Type type)Sets a new Type for the given local variable slot.java.lang.StringtoString()Returns a String representation of this object.
-
-
-
Method Detail
-
clone
public java.lang.Object clone()
Returns a deep copy of this object; i.e. the clone operates on a new local variable array. However, the Type objects in the array are shared.- Overrides:
clonein classjava.lang.Object
-
get
public Type get(int slotIndex)
Returns the type of the local variable slot index.- Parameters:
slotIndex- Slot to look up.- Returns:
- the type of the local variable slot index.
-
getClone
public LocalVariables getClone()
Returns a (correctly typed) clone of this object. This is equivalent to ((LocalVariables) this.clone()).- Returns:
- a (correctly typed) clone of this object.
-
maxLocals
public int maxLocals()
Returns the number of local variable slots.- Returns:
- the number of local variable slots.
-
set
public void set(int slotIndex, Type type)Sets a new Type for the given local variable slot.- Parameters:
slotIndex- Target slot index.type- Type to save at the given slot index.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code value for the object.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
merge
public void merge(LocalVariables localVariable)
Merges two local variables sets as described in the Java Virtual Machine Specification, Second Edition, section 4.9.2, page 146.- Parameters:
localVariable- other local variable.
-
toString
public java.lang.String toString()
Returns a String representation of this object.- Overrides:
toStringin classjava.lang.Object
-
initializeObject
public void initializeObject(UninitializedObjectType uninitializedObjectType)
Replaces all occurrences ofuninitializedObjectTypein this local variables set with an "initialized" ObjectType.- Parameters:
uninitializedObjectType- the object to match.
-
-