org.apache.commons.compress.harmony.unpack200.bytecode

## Class CPConstant

- java.lang.Object
- - org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
  - - org.apache.commons.compress.harmony.unpack200.bytecode.ConstantPoolEntry
    - - org.apache.commons.compress.harmony.unpack200.bytecode.CPConstant

- Direct Known Subclasses:
    CPConstantNumber, CPString

      public abstract class CPConstant
      extends ConstantPoolEntry

  Abstract superclass for constant pool constant entries such as numbers or Strings

- - ### Field Summary

    - ### Fields inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ConstantPoolEntry

      `CP_Class, CP_Double, CP_Fieldref, CP_Float, CP_Integer, CP_InterfaceMethodref, CP_Long, CP_Methodref, CP_NameAndType, CP_String, CP_UTF8, globalIndex`

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

      `NONE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CPConstant(byte tag, Object value, int globalIndex)` Create a new CPConstant

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `protected Object` | `getValue()`
    `int` | `hashCode()`

    - ### Methods inherited from class org.apache.commons.compress.harmony.unpack200.bytecode.ConstantPoolEntry

      `doWrite, getGlobalIndex, getTag, writeBody`

    - ### 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`

- - ### Constructor Detail

    - #### CPConstant

          public CPConstant(byte tag,
                            Object value,
                            int globalIndex)

      Create a new CPConstant
      Parameters:
        `tag` - TODO
        `value` - TODO
        `globalIndex` - index in CpBands
      Throws:
        `NullPointerException` - if value is null

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in class `ConstantPoolEntry`

    - #### getValue

          protected Object getValue()

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `ConstantPoolEntry`

Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.