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

## Class BCIRenumberedAttribute

- java.lang.Object
- - org.apache.commons.compress.harmony.unpack200.bytecode.ClassFileEntry
  - - org.apache.commons.compress.harmony.unpack200.bytecode.Attribute
    - - org.apache.commons.compress.harmony.unpack200.bytecode.BCIRenumberedAttribute

- Direct Known Subclasses:
    CodeAttribute, LineNumberTableAttribute, LocalVariableTableAttribute, LocalVariableTypeTableAttribute, NewAttribute

      public abstract class BCIRenumberedAttribute
      extends Attribute

  Abstract superclass for attributes that have some part encoded with a BCI renumbering

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `renumbered`

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

      `attributeName`

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

      `NONE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BCIRenumberedAttribute(CPUTF8 attributeName)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract int` | `getLength()`
    `protected abstract int[]` | `getStartPCs()`
    `boolean` | `hasBCIRenumbering()` Answer true if the receiver needs to have BCI renumbering applied to it; otherwise answer false.
    `void` | `renumber(List byteCodeOffsets)` In Pack200, line number tables are BCI renumbered.
    `abstract String` | `toString()`
    `protected abstract void` | `writeBody(DataOutputStream dos)`

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

      `doWrite, equals, getAttributeName, getLengthIncludingHeader, getNestedClassFileEntries, hashCode, isSourceFileAttribute, resolve`

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

    - #### renumbered

          protected boolean renumbered

  - ### Constructor Detail

    - #### BCIRenumberedAttribute

          public BCIRenumberedAttribute(CPUTF8 attributeName)

  - ### Method Detail

    - #### hasBCIRenumbering

          public boolean hasBCIRenumbering()

      Description copied from class: `Attribute`
      Answer true if the receiver needs to have BCI renumbering applied to it; otherwise answer false.
      Overrides:
        `hasBCIRenumbering` in class `Attribute`
      Returns:
        boolean BCI renumbering required

    - #### getLength

          protected abstract int getLength()

      Specified by:
        `getLength` in class `Attribute`

    - #### writeBody

          protected abstract void writeBody(DataOutputStream dos)
                                     throws IOException

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

    - #### toString

          public abstract String toString()

      Specified by:
        `toString` in class `ClassFileEntry`

    - #### getStartPCs

          protected abstract int[] getStartPCs()

    - #### renumber

          public void renumber(List byteCodeOffsets)
                        throws Pack200Exception

      In Pack200, line number tables are BCI renumbered. This method takes the byteCodeOffsets (which is a List of Integers specifying the offset in the byte code array of each instruction) and updates the start_pcs so that it points to the instruction index itself, not the BCI renumbering of the instruction.
      Parameters:
        `byteCodeOffsets` - List of Integer offsets of the bytecode array
      Throws:
        `Pack200Exception` - TODO

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