Class Item
java.lang.Object
com.googlecode.aviator.asm.Item
A constant pool item. Constant pool items can be created with the 'newXXX' methods in the
ClassWriter class.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intThe hash code value of this constant pool item.(package private) intIndex of this item in the constant pool.(package private) intValue of this item, for an integer item.(package private) longValue of this item, for a long item.(package private) ItemLink to another constant pool item, used for collision lists in the constant pool's hash table.(package private) StringFirst part of the value of this item, for items that do not hold a primitive value.(package private) StringSecond part of the value of this item, for items that do not hold a primitive value.(package private) StringThird part of the value of this item, for items that do not hold a primitive value.(package private) intType of this constant pool item. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleanIndicates if the given item is equal to this one.(package private) voidset(double doubleVal) Sets this item to a double item.(package private) voidset(float floatVal) Sets this item to a float item.(package private) voidset(int intVal) Sets this item to an integer item.(package private) voidset(int position, int hashCode) Sets the item to a BootstrapMethod item.(package private) voidSets this item to an item that do not hold a primitive value.(package private) voidset(long longVal) Sets this item to a long item.(package private) voidSets the item to an InvokeDynamic item.
-
Field Details
-
index
int indexIndex of this item in the constant pool. -
type
int typeType of this constant pool item. A single class is used to represent all constant pool item types, in order to minimize the bytecode size of this package. The value of this field is one ofClassWriter.INT,ClassWriter.LONG,ClassWriter.FLOAT,ClassWriter.DOUBLE,ClassWriter.UTF8,ClassWriter.STR,ClassWriter.CLASS,ClassWriter.NAME_TYPE,ClassWriter.FIELD,ClassWriter.METH,ClassWriter.IMETH,ClassWriter.MTYPE,ClassWriter.INDY. MethodHandle constant 9 variations are stored using a range of 9 values fromClassWriter.HANDLE_BASE+ 1 toClassWriter.HANDLE_BASE+ 9. Special Item types are used for Items that are stored in the ClassWriterClassWriter.typeTable, instead of the constant pool, in order to avoid clashes with normal constant pool items in the ClassWriter constant pool's hash table. These special item types areClassWriter.TYPE_NORMAL,ClassWriter.TYPE_UNINITandClassWriter.TYPE_MERGED. -
intVal
int intValValue of this item, for an integer item. -
longVal
long longValValue of this item, for a long item. -
strVal1
String strVal1First part of the value of this item, for items that do not hold a primitive value. -
strVal2
String strVal2Second part of the value of this item, for items that do not hold a primitive value. -
strVal3
String strVal3Third part of the value of this item, for items that do not hold a primitive value. -
hashCode
int hashCodeThe hash code value of this constant pool item. -
next
Item nextLink to another constant pool item, used for collision lists in the constant pool's hash table.
-
-
Constructor Details
-
Item
Item()Constructs an uninitializedItem. -
Item
Item(int index) Constructs an uninitializedItemfor 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
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
-
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
-