Class LocalVariablesInfo


  • public class LocalVariablesInfo
    extends java.lang.Object
    A utility class holding the information about the names and the types of the local variables in a given method.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalVariablesInfo​(int maxLocals)
      The constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int slot, java.lang.String name, int startPc, int length, Type type)
      Adds information about the local variable in slot 'slot'.
      LocalVariableInfo getLocalVariableInfo​(int slot)
      Returns the LocalVariableInfo for the given slot.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • localVariableInfos

        private final LocalVariableInfo[] localVariableInfos
        The information about the local variables is stored here.
    • Constructor Detail

      • LocalVariablesInfo

        LocalVariablesInfo​(int maxLocals)
        The constructor.
    • Method Detail

      • add

        public void add​(int slot,
                        java.lang.String name,
                        int startPc,
                        int length,
                        Type type)
                 throws LocalVariableInfoInconsistentException
        Adds information about the local variable in slot 'slot'. Automatically adds information for slot+1 if 't' is Type.LONG or Type.DOUBLE.
        Parameters:
        slot - Slot number for local variable information
        name - variable name
        startPc - Range in which the variable is valid.
        length - length of ...
        type - variable type
        Throws:
        LocalVariableInfoInconsistentException - if the new information conflicts with already gathered information.
      • getLocalVariableInfo

        public LocalVariableInfo getLocalVariableInfo​(int slot)
        Returns the LocalVariableInfo for the given slot.
        Parameters:
        slot - Slot to query.
        Returns:
        The LocalVariableInfo for the given slot.