java.lang.Object
org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
org.apache.commons.compress.harmony.unpack200.bytecode.ConstantPoolEntry
Direct Known Subclasses:
CPClass, CPConstant, CPFieldRef, CPNameAndType, CPRef, CPUTF8

public abstract class ConstantPoolEntry extends ClassFileEntry
Abstracts constant pool entries.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte
    The constant 0x7 for a constant pool class.
    static final byte
    The constant 0x6 for a constant pool double.
    static final byte
    The constant 0x9 for a constant pool field reference.
    static final byte
    The constant 0x4 for a constant pool float.
    static final byte
    The constant 0x3 for a constant pool int.
    static final byte
    The constant 0xb for a constant pool interface method reference.
    static final byte
    The constant 0x5 for a constant pool long.
    static final byte
    The constant 0xa for a constant pool method reference.
    static final byte
    The constant 0xc for a constant pool name and type.
    static final byte
    The constant 0x8 for a constant pool string.
    static final byte
    The constant 0x1 for a constant pool UTF8.
    protected int
    Global index.
    (package private) byte
    One-byte tag indicates the kind of constant.

    Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry

    NONE
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConstantPoolEntry(byte tag, int globalIndex)
    Constructs a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Writes this instance to the output stream.
    abstract boolean
     
    int
    Gets the global index.
    byte
    Gets the tag.
    abstract int
     
    protected abstract void
    Writes this instance to the given output stream.

    Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry

    getNestedClassFileEntries, objectHashCode, resolve, toString, write

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CP_Class

      public static final byte CP_Class
      The constant 0x7 for a constant pool class.
      See Also:
    • CP_Double

      public static final byte CP_Double
      The constant 0x6 for a constant pool double.
      See Also:
    • CP_Fieldref

      public static final byte CP_Fieldref
      The constant 0x9 for a constant pool field reference.
      See Also:
    • CP_Float

      public static final byte CP_Float
      The constant 0x4 for a constant pool float.
      See Also:
    • CP_Integer

      public static final byte CP_Integer
      The constant 0x3 for a constant pool int.
      See Also:
    • CP_InterfaceMethodref

      public static final byte CP_InterfaceMethodref
      The constant 0xb for a constant pool interface method reference.
      See Also:
    • CP_Long

      public static final byte CP_Long
      The constant 0x5 for a constant pool long.
      See Also:
    • CP_Methodref

      public static final byte CP_Methodref
      The constant 0xa for a constant pool method reference.
      See Also:
    • CP_NameAndType

      public static final byte CP_NameAndType
      The constant 0xc for a constant pool name and type.
      See Also:
    • CP_String

      public static final byte CP_String
      The constant 0x8 for a constant pool string.
      See Also:
    • CP_UTF8

      public static final byte CP_UTF8
      The constant 0x1 for a constant pool UTF8.
      See Also:
    • tag

      byte tag
      One-byte tag indicates the kind of constant.
    • globalIndex

      protected int globalIndex
      Global index.
  • Constructor Details

    • ConstantPoolEntry

      ConstantPoolEntry(byte tag, int globalIndex)
      Constructs a new instance.
      Parameters:
      tag - One-byte tag indicates the kind of constant.
      globalIndex - Global index.
  • Method Details

    • doWrite

      public void doWrite(DataOutputStream dos) throws IOException
      Description copied from class: ClassFileEntry
      Writes this instance to the output stream.
      Specified by:
      doWrite in class ClassFileEntry
      Parameters:
      dos - the output stream.
      Throws:
      IOException - if an I/O error occurs.
    • equals

      public abstract boolean equals(Object obj)
      Specified by:
      equals in class ClassFileEntry
    • getGlobalIndex

      public int getGlobalIndex()
      Gets the global index.
      Returns:
      the global index.
    • getTag

      public byte getTag()
      Gets the tag.
      Returns:
      the tag.
    • hashCode

      public abstract int hashCode()
      Specified by:
      hashCode in class ClassFileEntry
    • writeBody

      protected abstract void writeBody(DataOutputStream dos) throws IOException
      Writes this instance to the given output stream.
      Parameters:
      dos - the output stream.
      Throws:
      IOException - if an I/O error occurs.