public class CPUTF8 extends ConstantPoolEntry
UTF8 constant pool entry, used for storing long Strings.
  • Field Details

    • utf8

      private final String utf8
    • hashCodeComputed

      private boolean hashCodeComputed
    • cachedHashCode

      private int cachedHashCode
  • Constructor Details

    • CPUTF8

      public CPUTF8(String string)
      Constructs a new instance.
      Parameters:
      string - a constant pool string.
    • CPUTF8

      public CPUTF8(String string, int globalIndex)
      Creates a new instance
      Parameters:
      string - a constant pool string.
      globalIndex - index in CpBands
      Throws:
      NullPointerException - if utf8 is null.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in class ConstantPoolEntry
    • generateHashCode

      private void generateHashCode()
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class ConstantPoolEntry
    • setGlobalIndex

      public void setGlobalIndex(int index)
      Sets the global index.
      Parameters:
      index - the global index.
    • toString

      public String toString()
      Specified by:
      toString in class ClassFileEntry
    • underlyingString

      public String underlyingString()
      Gets the underlying string.
      Returns:
      the underlying string.
    • writeBody

      protected void writeBody(DataOutputStream dos) throws IOException
      Description copied from class: ConstantPoolEntry
      Writes this instance to the given output stream.
      Specified by:
      writeBody in class ConstantPoolEntry
      Parameters:
      dos - the output stream.
      Throws:
      IOException - if an I/O error occurs.