Class Item

java.lang.Object
org.eclipse.sisu.space.asm.Item

final class Item extends Object
A constant pool item. Constant pool items can be created with the 'newXXX' methods in the ClassWriter class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) int
    The hash code value of this constant pool item.
    (package private) int
    Index of this item in the constant pool.
    (package private) int
    Value of this item, for an integer item.
    (package private) long
    Value of this item, for a long item.
    (package private) Item
    Link to another constant pool item, used for collision lists in the constant pool's hash table.
    (package private) String
    First part of the value of this item, for items that do not hold a primitive value.
    (package private) String
    Second part of the value of this item, for items that do not hold a primitive value.
    (package private) String
    Third part of the value of this item, for items that do not hold a primitive value.
    (package private) int
    Type of this constant pool item.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an uninitialized Item.
    Item(int index)
    Constructs an uninitialized Item for constant pool element at given position.
    Item(int index, Item i)
    Constructs a copy of the given item.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) boolean
    Indicates if the given item is equal to this one.
    (package private) void
    set(double doubleVal)
    Sets this item to a double item.
    (package private) void
    set(float floatVal)
    Sets this item to a float item.
    (package private) void
    set(int intVal)
    Sets this item to an integer item.
    (package private) void
    set(int position, int hashCode)
    Sets the item to a BootstrapMethod item.
    (package private) void
    set(int type, String strVal1, String strVal2, String strVal3)
    Sets this item to an item that do not hold a primitive value.
    (package private) void
    set(long longVal)
    Sets this item to a long item.
    (package private) void
    set(String name, String desc, int bsmIndex)
    Sets the item to an InvokeDynamic item.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Item

      Item()
      Constructs an uninitialized Item.
    • Item

      Item(int index)
      Constructs an uninitialized Item for constant pool element at given position.
      Parameters:
      index - index of the item to be constructed.
    • Item

      Item(int index, Item i)
      Constructs a copy of the given item.
      Parameters:
      index - index of the item to be constructed.
      i - the item that must be copied into the item to be constructed.
  • Method Details

    • set

      void set(int intVal)
      Sets this item to an integer item.
      Parameters:
      intVal - the value of this item.
    • set

      void set(long longVal)
      Sets this item to a long item.
      Parameters:
      longVal - the value of this item.
    • set

      void set(float floatVal)
      Sets this item to a float item.
      Parameters:
      floatVal - the value of this item.
    • set

      void set(double doubleVal)
      Sets this item to a double item.
      Parameters:
      doubleVal - the value of this item.
    • set

      void set(int type, String strVal1, String strVal2, String strVal3)
      Sets this item to an item that do not hold a primitive value.
      Parameters:
      type - the type of this item.
      strVal1 - first part of the value of this item.
      strVal2 - second part of the value of this item.
      strVal3 - third part of the value of this item.
    • set

      void set(String name, String desc, int bsmIndex)
      Sets the item to an InvokeDynamic item.
      Parameters:
      name - invokedynamic's name.
      desc - invokedynamic's desc.
      bsmIndex - zero based index into the class attribute BootrapMethods.
    • set

      void set(int position, int hashCode)
      Sets the item to a BootstrapMethod item.
      Parameters:
      position - position in byte in the class attribute BootrapMethods.
      hashCode - hashcode of the item. This hashcode is processed from the hashcode of the bootstrap method and the hashcode of all bootstrap arguments.
    • isEqualTo

      boolean isEqualTo(Item i)
      Indicates if the given item is equal to this one. This method assumes that the two items have the same type.
      Parameters:
      i - the item to be compared to this one. Both items must have the same type.
      Returns:
      true if the given item if equal to this one, false otherwise.