org.apache.bcel.classfile

## Class StackMapEntry

- java.lang.Object
- - org.apache.bcel.classfile.StackMapEntry

- All Implemented Interfaces:
    Cloneable, Node

      public final class StackMapEntry
      extends Object
      implements Node, Cloneable

  This class represents a stack map entry recording the types of local variables and the the of stack items at a given byte code offset. See CLDC specification 5.3.1.2
  Version:
    $Id: StackMapEntry.java 1808136 2017-09-12 16:51:32Z britter $
  See Also:
    `StackMap`, `StackMapType`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StackMapEntry(int byteCodeOffset, int numberOfLocals, StackMapType[] typesOfLocals, int numberOfStackItems, StackMapType[] typesOfStackItems, ConstantPool constantPool)` Deprecated. Since 6.0, use `StackMapEntry(int, int, StackMapType[], StackMapType[], ConstantPool)` instead
    `StackMapEntry(int tag, int byteCodeOffset, StackMapType[] typesOfLocals, StackMapType[] typesOfStackItems, ConstantPool constantPool)` Create an instance

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `accept(Visitor v)` Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
    `StackMapEntry` | `copy()`
    `void` | `dump(DataOutputStream file)` Dump stack map entry
    `int` | `getByteCodeOffset()`
    `ConstantPool` | `getConstantPool()`
    `int` | `getFrameType()`
    `int` | `getNumberOfLocals()`
    `int` | `getNumberOfStackItems()`
    `StackMapType[]` | `getTypesOfLocals()`
    `StackMapType[]` | `getTypesOfStackItems()`
    `void` | `setByteCodeOffset(int new_offset)`
    `void` | `setConstantPool(ConstantPool constant_pool)`
    `void` | `setFrameType(int f)`
    `void` | `setNumberOfLocals(int n)` Deprecated. since 6.0
    `void` | `setNumberOfStackItems(int n)` Deprecated. since 6.0
    `void` | `setTypesOfLocals(StackMapType[] types)`
    `void` | `setTypesOfStackItems(StackMapType[] types)`
    `String` | `toString()`
    `void` | `updateByteCodeOffset(int delta)` Update the distance (as an offset delta) from this StackMap entry to the next.

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

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

- - ### Constructor Detail

    - #### StackMapEntry

          @Deprecated
          public StackMapEntry(int byteCodeOffset,
                                            int numberOfLocals,
                                            StackMapType[] typesOfLocals,
                                            int numberOfStackItems,
                                            StackMapType[] typesOfStackItems,
                                            ConstantPool constantPool)

      Deprecated. Since 6.0, use `StackMapEntry(int, int, StackMapType[], StackMapType[], ConstantPool)` instead
      DO NOT USE
      Parameters:
        `byteCodeOffset` -
        `numberOfLocals` - NOT USED
        `typesOfLocals` - array of `StackMapType`s of locals
        `numberOfStackItems` - NOT USED
        `typesOfStackItems` - array ot `StackMapType`s of stack items
        `constantPool` - the constant pool

    - #### StackMapEntry

          public StackMapEntry(int tag,
                               int byteCodeOffset,
                               StackMapType[] typesOfLocals,
                               StackMapType[] typesOfStackItems,
                               ConstantPool constantPool)

      Create an instance
      Parameters:
        `tag` - the frame_type to use
        `byteCodeOffset` -
        `typesOfLocals` - array of `StackMapType`s of locals
        `typesOfStackItems` - array ot `StackMapType`s of stack items
        `constantPool` - the constant pool

  - ### Method Detail

    - #### dump

          public final void dump(DataOutputStream file)
                          throws IOException

      Dump stack map entry
      Parameters:
        `file` - Output file stream
      Throws:
        `IOException`

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`
      Returns:
        String representation.

    - #### setFrameType

          public void setFrameType(int f)

    - #### getFrameType

          public int getFrameType()

    - #### setByteCodeOffset

          public void setByteCodeOffset(int new_offset)

    - #### updateByteCodeOffset

          public void updateByteCodeOffset(int delta)

      Update the distance (as an offset delta) from this StackMap entry to the next. Note that this might cause the the frame type to change. Note also that delta may be negative.
      Parameters:
        `delta` - offset delta

    - #### getByteCodeOffset

          public int getByteCodeOffset()

    - #### setNumberOfLocals

          @Deprecated
          public void setNumberOfLocals(int n)

      Deprecated. since 6.0

    - #### getNumberOfLocals

          public int getNumberOfLocals()

    - #### setTypesOfLocals

          public void setTypesOfLocals(StackMapType[] types)

    - #### getTypesOfLocals

          public StackMapType[] getTypesOfLocals()

    - #### setNumberOfStackItems

          @Deprecated
          public void setNumberOfStackItems(int n)

      Deprecated. since 6.0

    - #### getNumberOfStackItems

          public int getNumberOfStackItems()

    - #### setTypesOfStackItems

          public void setTypesOfStackItems(StackMapType[] types)

    - #### getTypesOfStackItems

          public StackMapType[] getTypesOfStackItems()

    - #### copy

          public StackMapEntry copy()

      Returns:
        deep copy of this object

    - #### accept

          public void accept(Visitor v)

      Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
      Specified by:
        `accept` in interface `Node`
      Parameters:
        `v` - Visitor object

    - #### getConstantPool

          public final ConstantPool getConstantPool()

      Returns:
        Constant pool used by this object.

    - #### setConstantPool

          public final void setConstantPool(ConstantPool constant_pool)

      Parameters:
        `constant_pool` - Constant pool to be used for this object.

Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.