|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface JConstantPool
An object of the JConstantPool interface represents the constant pool of a classfile.
The constant pool is a table of structures representing various string constants, class and interface names, field names, and other constants that are referred to within the classfile structure and its substructures. Those data is designed to be symbolic informations. Java virtual machine instructions do not rely on the runtime layout of classes, interfaces, class instances, or arrays. Instead, instructions refer to those symbolic information in the constant pool table.
JConstant| Method Summary | |
|---|---|
int |
addConstant(JConstant constant)
Adds the specified constant in this constant pool. |
int |
addConstantClass(java.lang.String className)
Adds a new CONSTANT_Class_info entry corresponding to the specified class name. |
int |
addConstantDouble(double doubleValue)
Adds a new CONSTANT_Double_info entry initialized with the specified value. |
int |
addConstantFieldref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
Adds a new CONSTANT_Fieldref_info entry. |
int |
addConstantFloat(float floatValue)
Adds a new CONSTANT_Float_info entry initialized with the specified value. |
int |
addConstantInteger(int intValue)
Adds a new CONSTANT_Integer_info entry initialized with the specified value. |
int |
addConstantInterfaceMethodref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
Adds a new CONSTANT_InterfaceMethodref_info entry. |
int |
addConstantLong(long longValue)
Adds a new CONSTANT_Long_info entry initialized with the specified value. |
int |
addConstantMethodref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
Adds a new CONSTANT_Methodref_info entry. |
int |
addConstantNameAndType(java.lang.String name,
java.lang.String descriptor)
Adds a new CONSTANT_NameAndType_info entry. |
int |
addConstantString(java.lang.String string)
Adds a new CONSTANT_String_info entry initialized with the specified string value. |
int |
addConstantUtf8(java.lang.String string)
Adds a new CONSTANT_Utf8_info entry initialized with the specified string value. |
JConstant |
getConstant(int index)
Returns the entry at the specified position in this constant pool. |
JConstant[] |
getConstants()
Returns an array containing all the constant pool entries. |
int |
length()
Returns the number of entries in this constant pool. |
java.lang.String |
toString()
Returns a string representation of this constant pool, containing the String representation of each entry. |
| Methods inherited from interface fr.umlv.corosol.classfile.JClassFileItem |
|---|
getConstantPool, readItem, setConstantPool, writeItem |
| Method Detail |
|---|
int addConstant(JConstant constant)
constant - entry to be added to this constant pool
int addConstantClass(java.lang.String className)
className - a class name
int addConstantNameAndType(java.lang.String name,
java.lang.String descriptor)
name - the name of a field or a methoddescriptor - the descriptor of a field or a method
int addConstantFieldref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
className - the name of a classname - the name of the fielddesc - the descriptor of the field
int addConstantMethodref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
className - the name of a classname - the name of the fielddesc - the descriptor of the field
int addConstantInterfaceMethodref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
className - the name of a classname - the name of the interface methoddesc - the descriptor of the interface method
int addConstantString(java.lang.String string)
string - the string to be stored in the new entry
int addConstantUtf8(java.lang.String string)
string - the string to be stored in the new entry
int addConstantInteger(int intValue)
intValue - the value to be stored in the new entry
int addConstantFloat(float floatValue)
floatValue - the value to be stored in the new entry
int addConstantLong(long longValue)
longValue - the value to be stored in the new entry
int addConstantDouble(double doubleValue)
doubleValue - the value to be stored in the new entry
int length()
JConstant getConstant(int index)
index - index of entry to return
JConstant[] getConstants()
java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||