Package serp.bytecode

Class LocalVariableTypeTable

  • All Implemented Interfaces:
    BCEntity, InstructionPtr, VisitAcceptor

    public class LocalVariableTypeTable
    extends LocalTable
    Code blocks compiled from source have local variable type tables mapping generics-using locals used in opcodes to their names and signatures.
    • Constructor Detail

      • LocalVariableTypeTable

        LocalVariableTypeTable​(int nameIndex,
                               Attributes owner)
    • Method Detail

      • getLocalVariableTypes

        public LocalVariableType[] getLocalVariableTypes()
        Return all the locals of this method.
      • getLocalVariableType

        public LocalVariableType getLocalVariableType​(int local)
        Return the local with the given locals index, or null if none.
      • getLocalVariableType

        public LocalVariableType getLocalVariableType​(java.lang.String name)
        Return the local with the given name, or null if none. If multiple locals have the given name, which is returned is undefined.
      • getLocalVariableTypes

        public LocalVariableType[] getLocalVariableTypes​(java.lang.String name)
        Return all locals with the given name, or empty array if none.
      • addLocalVariableType

        public LocalVariableType addLocalVariableType​(LocalVariableType local)
        Import a local from another method/class. Note that the program counter and length from the given local is copied directly, and thus will be incorrect unless this method is the same as the one the local is copied from, or the pc and length are reset.
      • addLocalVariableType

        public LocalVariableType addLocalVariableType()
        Add a local to this table.
      • addLocalVariableType

        public LocalVariableType addLocalVariableType​(java.lang.String name,
                                                      java.lang.String type)
        Add a local to this table.
      • acceptVisit

        public void acceptVisit​(BCVisitor visit)
        Description copied from interface: VisitAcceptor
        Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.