com.caucho.bytecode
Class ConstantPool

java.lang.Object
  extended by com.caucho.bytecode.ConstantPool

public class ConstantPool
extends java.lang.Object

Represents a constant pool entry.


Field Summary
static int CP_CLASS
           
static int CP_DOUBLE
           
static int CP_FIELD_REF
           
static int CP_FLOAT
           
static int CP_INTEGER
           
static int CP_INTERFACE_METHOD_REF
           
static int CP_LONG
           
static int CP_METHOD_REF
           
static int CP_NAME_AND_TYPE
           
static int CP_STRING
           
static int CP_UTF8
           
 
Method Summary
 ClassConstant addClass(java.lang.String name)
          Adds a class constant.
 void addConstant(ConstantPoolEntry entry)
          Adds a new constant.
 DoubleConstant addDouble(double value)
          Adds a double constant.
 FieldRefConstant addFieldRef(java.lang.String className, java.lang.String name, java.lang.String type)
          Adds a field ref constant.
 FloatConstant addFloat(float value)
          Adds a float constant.
 IntegerConstant addInteger(int value)
          Adds a integer constant.
 InterfaceMethodRefConstant addInterfaceRef(java.lang.String className, java.lang.String name, java.lang.String type)
          Adds an interface ref constant.
 LongConstant addLong(long value)
          Adds a long constant.
 MethodRefConstant addMethodRef(java.lang.String className, java.lang.String name, java.lang.String type)
          Adds a method ref constant.
 NameAndTypeConstant addNameAndType(java.lang.String name, java.lang.String type)
          Adds a name-and-type constant.
 StringConstant addString(java.lang.String name)
          Adds a string constant.
 Utf8Constant addUTF8(java.lang.String value)
          Adds a UTF-8 constant.
 ClassConstant getClass(int index)
          Returns a class constant
 ClassConstant getClass(java.lang.String name)
          Gets a class constant.
 DoubleConstant getDouble(int index)
          Returns a double constant
 DoubleConstant getDoubleByValue(double value)
          Gets a double constant.
 java.util.ArrayList<ConstantPoolEntry> getEntries()
          Returns all the entries.
 ConstantPoolEntry getEntry(int index)
          Returns an entry
 FieldRefConstant getFieldRef(int index)
          Returns a field ref entry
 FieldRefConstant getFieldRef(java.lang.String name)
          Gets a field ref constant.
 FieldRefConstant getFieldRef(java.lang.String className, java.lang.String name, java.lang.String type)
          Gets a field ref constant.
 FloatConstant getFloat(int index)
          Returns a float constant
 FloatConstant getFloatByValue(float value)
          Gets a float constant.
 IntegerConstant getInteger(int index)
          Returns an integer constant
 IntegerConstant getIntegerByValue(int value)
          Gets a integer constant.
 InterfaceMethodRefConstant getInterfaceMethodRef(int index)
          Returns an interface method ref entry
 InterfaceMethodRefConstant getInterfaceRef(java.lang.String className, java.lang.String name, java.lang.String type)
          Gets an interface constant.
 LongConstant getLong(int index)
          Returns a long constant
 LongConstant getLongByValue(long value)
          Gets a long constant.
 MethodRefConstant getMethodRef(int index)
          Returns a method ref entry
 MethodRefConstant getMethodRef(java.lang.String className, java.lang.String name, java.lang.String type)
          Gets a method ref constant.
 NameAndTypeConstant getNameAndType(int index)
          Returns a name-and-type constant
 NameAndTypeConstant getNameAndType(java.lang.String name, java.lang.String type)
          Gets a name-and-type constant.
 StringConstant getString(int index)
          Returns a string constant
 StringConstant getString(java.lang.String name)
          Gets a string constant.
 Utf8Constant getUtf8(int index)
          Returns a utf-8 constant
 Utf8Constant getUTF8(java.lang.String value)
          Gets a UTF-8 constant.
 java.lang.String getUtf8AsString(int index)
          Returns a utf-8 constant as a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CP_CLASS

public static final int CP_CLASS
See Also:
Constant Field Values

CP_FIELD_REF

public static final int CP_FIELD_REF
See Also:
Constant Field Values

CP_METHOD_REF

public static final int CP_METHOD_REF
See Also:
Constant Field Values

CP_INTERFACE_METHOD_REF

public static final int CP_INTERFACE_METHOD_REF
See Also:
Constant Field Values

CP_STRING

public static final int CP_STRING
See Also:
Constant Field Values

CP_INTEGER

public static final int CP_INTEGER
See Also:
Constant Field Values

CP_FLOAT

public static final int CP_FLOAT
See Also:
Constant Field Values

CP_LONG

public static final int CP_LONG
See Also:
Constant Field Values

CP_DOUBLE

public static final int CP_DOUBLE
See Also:
Constant Field Values

CP_NAME_AND_TYPE

public static final int CP_NAME_AND_TYPE
See Also:
Constant Field Values

CP_UTF8

public static final int CP_UTF8
See Also:
Constant Field Values
Method Detail

getEntry

public ConstantPoolEntry getEntry(int index)
Returns an entry


getEntries

public java.util.ArrayList<ConstantPoolEntry> getEntries()
Returns all the entries.


getClass

public ClassConstant getClass(int index)
Returns a class constant


getFieldRef

public FieldRefConstant getFieldRef(int index)
Returns a field ref entry


getMethodRef

public MethodRefConstant getMethodRef(int index)
Returns a method ref entry


getInterfaceMethodRef

public InterfaceMethodRefConstant getInterfaceMethodRef(int index)
Returns an interface method ref entry


getString

public StringConstant getString(int index)
Returns a string constant


getInteger

public IntegerConstant getInteger(int index)
Returns an integer constant


getLong

public LongConstant getLong(int index)
Returns a long constant


getFloat

public FloatConstant getFloat(int index)
Returns a float constant


getDouble

public DoubleConstant getDouble(int index)
Returns a double constant


getNameAndType

public NameAndTypeConstant getNameAndType(int index)
Returns a name-and-type constant


getUtf8

public Utf8Constant getUtf8(int index)
Returns a utf-8 constant


getUtf8AsString

public java.lang.String getUtf8AsString(int index)
Returns a utf-8 constant as a string


addConstant

public void addConstant(ConstantPoolEntry entry)
Adds a new constant.


getUTF8

public Utf8Constant getUTF8(java.lang.String value)
Gets a UTF-8 constant.


addUTF8

public Utf8Constant addUTF8(java.lang.String value)
Adds a UTF-8 constant.


getString

public StringConstant getString(java.lang.String name)
Gets a string constant.


addString

public StringConstant addString(java.lang.String name)
Adds a string constant.


getIntegerByValue

public IntegerConstant getIntegerByValue(int value)
Gets a integer constant.


addInteger

public IntegerConstant addInteger(int value)
Adds a integer constant.


getLongByValue

public LongConstant getLongByValue(long value)
Gets a long constant.


addLong

public LongConstant addLong(long value)
Adds a long constant.


getFloatByValue

public FloatConstant getFloatByValue(float value)
Gets a float constant.


addFloat

public FloatConstant addFloat(float value)
Adds a float constant.


getDoubleByValue

public DoubleConstant getDoubleByValue(double value)
Gets a double constant.


addDouble

public DoubleConstant addDouble(double value)
Adds a double constant.


getClass

public ClassConstant getClass(java.lang.String name)
Gets a class constant.


addClass

public ClassConstant addClass(java.lang.String name)
Adds a class constant.


getNameAndType

public NameAndTypeConstant getNameAndType(java.lang.String name,
                                          java.lang.String type)
Gets a name-and-type constant.


addNameAndType

public NameAndTypeConstant addNameAndType(java.lang.String name,
                                          java.lang.String type)
Adds a name-and-type constant.


getFieldRef

public FieldRefConstant getFieldRef(java.lang.String className,
                                    java.lang.String name,
                                    java.lang.String type)
Gets a field ref constant.


getFieldRef

public FieldRefConstant getFieldRef(java.lang.String name)
Gets a field ref constant.


addFieldRef

public FieldRefConstant addFieldRef(java.lang.String className,
                                    java.lang.String name,
                                    java.lang.String type)
Adds a field ref constant.


getMethodRef

public MethodRefConstant getMethodRef(java.lang.String className,
                                      java.lang.String name,
                                      java.lang.String type)
Gets a method ref constant.


addMethodRef

public MethodRefConstant addMethodRef(java.lang.String className,
                                      java.lang.String name,
                                      java.lang.String type)
Adds a method ref constant.


getInterfaceRef

public InterfaceMethodRefConstant getInterfaceRef(java.lang.String className,
                                                  java.lang.String name,
                                                  java.lang.String type)
Gets an interface constant.


addInterfaceRef

public InterfaceMethodRefConstant addInterfaceRef(java.lang.String className,
                                                  java.lang.String name,
                                                  java.lang.String type)
Adds an interface ref constant.