Class LocalVariableTable


  • public class LocalVariableTable
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalVariableTable​(int maxLocals)
      Create an instance without any debug details.
      LocalVariableTable​(int maxLocals, ConstantPool constantPool, java.io.DataInputStream input)
      Create a new instance of the code attribute "LocalVariableTable".
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getMaxLocals()
      Get the count of variables/slots.
      LocalVariable[] getTable()
      Get the declared local variables
      • Methods inherited from class java.lang.Object

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

      • maxLocals

        private final int maxLocals
    • Constructor Detail

      • LocalVariableTable

        LocalVariableTable​(int maxLocals,
                           ConstantPool constantPool,
                           java.io.DataInputStream input)
                    throws java.io.IOException
        Create a new instance of the code attribute "LocalVariableTable". http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.13 http://docs.oracle.com/javase/specs/jvms/se5.0/html/ClassFile.doc.html#5956
        Parameters:
        maxLocals - the count of local variables in the memory
        constantPool - Reference to the current ConstantPool
        input - the stream of the class
        Throws:
        java.io.IOException - if any I/O error occurs.
      • LocalVariableTable

        LocalVariableTable​(int maxLocals)
        Create an instance without any debug details.
        Parameters:
        maxLocals - the count of local variables in the memory
    • Method Detail

      • getMaxLocals

        public int getMaxLocals()
        Get the count of variables/slots. This is not the count of declared LocalVariable in this table. There can be unnamed helper variables for the compiler which are not in the table. There can be reused slots for different variables.
        Returns:
        the count
      • getTable

        public LocalVariable[] getTable()
        Get the declared local variables
        Returns:
        the variables