org.compass.core.util.asm
Class Item

java.lang.Object
  extended by org.compass.core.util.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.

Author:
Eric Bruneton

Field Summary
(package private)  int hashCode
          The hash code value of this constant pool item.
(package private)  int index
          Index of this item in the constant pool.
(package private)  int intVal
          Value of this item, for an integer item.
(package private)  long longVal
          Value of this item, for a long item.
(package private)  Item next
          Link to another constant pool item, used for collision lists in the constant pool's hash table.
(package private)  String strVal1
          First part of the value of this item, for items that do not hold a primitive value.
(package private)  String strVal2
          Second part of the value of this item, for items that do not hold a primitive value.
(package private)  String strVal3
          Third part of the value of this item, for items that do not hold a primitive value.
(package private)  int type
          Type of this constant pool item.
 
Constructor Summary
Item()
          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
(package private)  boolean isEqualTo(Item i)
          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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

int index
Index of this item in the constant pool.


type

int type
Type 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 of ClassWriter.INT, ClassWriter.LONG, ClassWriter.FLOAT, ClassWriter.DOUBLE, ClassWriter.UTF8, ClassWriter.STR, ClassWriter.CLASS, ClassWriter.NAME_TYPE, ClassWriter.FIELD, ClassWriter.METH, ClassWriter.IMETH. Special Item types are used for Items that are stored in the ClassWriter ClassWriter.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 are ClassWriter.TYPE_NORMAL, ClassWriter.TYPE_UNINIT and ClassWriter.TYPE_MERGED.


intVal

int intVal
Value of this item, for an integer item.


longVal

long longVal
Value of this item, for a long item.


strVal1

String strVal1
First part of the value of this item, for items that do not hold a primitive value.


strVal2

String strVal2
Second part of the value of this item, for items that do not hold a primitive value.


strVal3

String strVal3
Third part of the value of this item, for items that do not hold a primitive value.


hashCode

int hashCode
The hash code value of this constant pool item.


next

Item next
Link to another constant pool item, used for collision lists in the constant pool's hash table.

Constructor Detail

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 Detail

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.

isEqualTo

boolean isEqualTo(Item i)
Indicates if the given item is equal to this one.

Parameters:
i - the item to be compared to this one.
Returns:
true if the given item if equal to this one, false otherwise.


Copyright (c) 2004-2008 The Compass Project.