org.apache.bcel.verifier.structurals

## Class LocalVariables

- java.lang.Object
- - org.apache.bcel.verifier.structurals.LocalVariables

- All Implemented Interfaces:
    Cloneable

      public class LocalVariables
      extends Object
      implements Cloneable

  This class implements an array of local variables used for symbolic JVM simulation.
  Version:
    $Id: LocalVariables.java 1806200 2017-08-25 16:33:06Z ggregory $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalVariables(int maxLocals)` Creates a new LocalVariables object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()` Returns a deep copy of this object; i.e.
    `boolean` | `equals(Object o)`
    `Type` | `get(int i)` Returns the type of the local variable slot i.
    `LocalVariables` | `getClone()` Returns a (correctly typed) clone of this object.
    `int` | `hashCode()`
    `void` | `initializeObject(UninitializedObjectType u)` Replaces all occurences of u in this local variables set with an "initialized" ObjectType.
    `int` | `maxLocals()` Returns the number of local variable slots this LocalVariables instance has.
    `void` | `merge(LocalVariables lv)` Merges two local variables sets as described in the Java Virtual Machine Specification, Second Edition, section 4.9.2, page 146.
    `void` | `set(int i, Type type)` Sets a new Type for the given local variable slot.
    `String` | `toString()` Returns a String representation of this object.

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LocalVariables

          public LocalVariables(int maxLocals)

      Creates a new LocalVariables object.

  - ### Method Detail

    - #### clone

          public 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:
        `clone` in class `Object`

    - #### get

          public Type get(int i)

      Returns the type of the local variable slot i.

    - #### getClone

          public LocalVariables getClone()

      Returns a (correctly typed) clone of this object. This is equivalent to ((LocalVariables) this.clone()).

    - #### maxLocals

          public int maxLocals()

      Returns the number of local variable slots this LocalVariables instance has.

    - #### set

          public void set(int i,
                          Type type)

      Sets a new Type for the given local variable slot.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`
      Returns:
        a hash code value for the object.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### merge

          public void merge(LocalVariables lv)

      Merges two local variables sets as described in the Java Virtual Machine Specification, Second Edition, section 4.9.2, page 146.

    - #### toString

          public String toString()

      Returns a String representation of this object.
      Overrides:
        `toString` in class `Object`

    - #### initializeObject

          public void initializeObject(UninitializedObjectType u)

      Replaces all occurences of u in this local variables set with an "initialized" ObjectType.

Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.