public class ConstantPool
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 |
Modifier and Type | Method and Description |
---|---|
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
|
public static final int CP_CLASS
public static final int CP_FIELD_REF
public static final int CP_METHOD_REF
public static final int CP_INTERFACE_METHOD_REF
public static final int CP_STRING
public static final int CP_INTEGER
public static final int CP_FLOAT
public static final int CP_LONG
public static final int CP_DOUBLE
public static final int CP_NAME_AND_TYPE
public static final int CP_UTF8
public ConstantPoolEntry getEntry(int index)
public java.util.ArrayList<ConstantPoolEntry> getEntries()
public ClassConstant getClass(int index)
public FieldRefConstant getFieldRef(int index)
public MethodRefConstant getMethodRef(int index)
public InterfaceMethodRefConstant getInterfaceMethodRef(int index)
public StringConstant getString(int index)
public IntegerConstant getInteger(int index)
public LongConstant getLong(int index)
public FloatConstant getFloat(int index)
public DoubleConstant getDouble(int index)
public NameAndTypeConstant getNameAndType(int index)
public Utf8Constant getUtf8(int index)
public java.lang.String getUtf8AsString(int index)
public void addConstant(ConstantPoolEntry entry)
public Utf8Constant getUTF8(java.lang.String value)
public Utf8Constant addUTF8(java.lang.String value)
public StringConstant getString(java.lang.String name)
public StringConstant addString(java.lang.String name)
public IntegerConstant getIntegerByValue(int value)
public IntegerConstant addInteger(int value)
public LongConstant getLongByValue(long value)
public LongConstant addLong(long value)
public FloatConstant getFloatByValue(float value)
public FloatConstant addFloat(float value)
public DoubleConstant getDoubleByValue(double value)
public DoubleConstant addDouble(double value)
public ClassConstant getClass(java.lang.String name)
public ClassConstant addClass(java.lang.String name)
public NameAndTypeConstant getNameAndType(java.lang.String name, java.lang.String type)
public NameAndTypeConstant addNameAndType(java.lang.String name, java.lang.String type)
public FieldRefConstant getFieldRef(java.lang.String className, java.lang.String name, java.lang.String type)
public FieldRefConstant getFieldRef(java.lang.String name)
public FieldRefConstant addFieldRef(java.lang.String className, java.lang.String name, java.lang.String type)
public MethodRefConstant getMethodRef(java.lang.String className, java.lang.String name, java.lang.String type)
public MethodRefConstant addMethodRef(java.lang.String className, java.lang.String name, java.lang.String type)
public InterfaceMethodRefConstant getInterfaceRef(java.lang.String className, java.lang.String name, java.lang.String type)
public InterfaceMethodRefConstant addInterfaceRef(java.lang.String className, java.lang.String name, java.lang.String type)