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

## Class CPRef

- 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.CPRef

- Direct Known Subclasses:
    CPInterfaceMethodRef, CPMethodRef

      public abstract class CPRef
      extends ConstantPoolEntry

  Abstract superclass for reference constant pool entries, such as a method or field reference.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `cachedToString`
    `protected CPNameAndType` | `nameAndType`

    - ### 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
    `CPRef(byte type, CPClass className, CPNameAndType descriptor, int globalIndex)` Create a new CPRef

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `protected ClassFileEntry[]` | `getNestedClassFileEntries()`
    `protected void` | `resolve(ClassConstantPool pool)` Allows the constant pool entries to resolve their nested entries.
    `String` | `toString()`
    `protected void` | `writeBody(DataOutputStream dos)`

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

      `doWrite, getGlobalIndex, getTag, hashCode`

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

      `objectHashCode, write`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### nameAndType

          protected CPNameAndType nameAndType

    - #### cachedToString

          protected String cachedToString

  - ### Constructor Detail

    - #### CPRef

          public CPRef(byte type,
                       CPClass className,
                       CPNameAndType descriptor,
                       int globalIndex)

      Create a new CPRef
      Parameters:
        `type` - TODO
        `className` - TODO
        `descriptor` - TODO
        `globalIndex` - index in CpBands
      Throws:
        `NullPointerException` - if descriptor or className is null

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in class `ConstantPoolEntry`

    - #### getNestedClassFileEntries

          protected ClassFileEntry[] getNestedClassFileEntries()

      Overrides:
        `getNestedClassFileEntries` in class `ClassFileEntry`

    - #### resolve

          protected void resolve(ClassConstantPool pool)

      Description copied from class: `ClassFileEntry`
      Allows the constant pool entries to resolve their nested entries.
      Overrides:
        `resolve` in class `ClassFileEntry`
      Parameters:
        `pool` - TODO

    - #### toString

          public String toString()

      Specified by:
        `toString` in class `ClassFileEntry`

    - #### writeBody

          protected void writeBody(DataOutputStream dos)
                            throws IOException

      Specified by:
        `writeBody` in class `ConstantPoolEntry`
      Throws:
        `IOException`

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