Class ComplexEntry

java.lang.Object
serp.bytecode.lowlevel.Entry
serp.bytecode.lowlevel.ComplexEntry
All Implemented Interfaces:
VisitAcceptor
Direct Known Subclasses:
FieldEntry, InterfaceMethodEntry, MethodEntry

public abstract class ComplexEntry extends Entry
Base class for field, method, and interface method constant pool entries. All complex entries reference the ClassEntry of the class that owns the entity and a NameAndTypeEntry describing the entity.
  • Field Details

    • _classIndex

      private int _classIndex
    • _nameAndTypeIndex

      private int _nameAndTypeIndex
  • Constructor Details

    • ComplexEntry

      public ComplexEntry()
      Default constructor.
    • ComplexEntry

      public ComplexEntry(int classIndex, int nameAndTypeIndex)
      Constructor.
      Parameters:
      classIndex - the constant pool index of the ClassEntry describing the owner of this entity
      nameAndTypeIndex - the constant pool index of the NameAndTypeEntry describing this entity
  • Method Details

    • getClassIndex

      public int getClassIndex()
      Return the constant pool index of the ClassEntry describing the owning class of this entity. Defaults to 0.
    • setClassIndex

      public void setClassIndex(int classIndex)
      Set the constant pool index of the ClassEntry describing the owning class of this entity.
    • getClassEntry

      public ClassEntry getClassEntry()
      Return the referenced ClassEntry. This method can only be run for entries that have been added to a constant pool.
    • getNameAndTypeIndex

      public int getNameAndTypeIndex()
      Return the constant pool index of the NameAndTypeEntry describing this entity.
    • setNameAndTypeIndex

      public void setNameAndTypeIndex(int nameAndTypeIndex)
      Set the constant pool index of the NameAndTypeEntry describing this entity.
    • getNameAndTypeEntry

      public NameAndTypeEntry getNameAndTypeEntry()
      Return the referenced NameAndTypeEntry. This method can only be run for entries that have been added to a constant pool.
    • readData

      void readData(DataInput in) throws IOException
      Description copied from class: Entry
      This method is called after reading the entry type from bytecode. It should read all the data for this entry from the given stream.
      Specified by:
      readData in class Entry
      Throws:
      IOException
    • writeData

      void writeData(DataOutput out) throws IOException
      Description copied from class: Entry
      This method is called after writing the entry type to bytecode. It should write all data for this entry to the given stream.
      Specified by:
      writeData in class Entry
      Throws:
      IOException