|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfr.umlv.corosol.classfile.constant.impl.DefaultJConstantPool
public class DefaultJConstantPool
The default implementation of the fr.umlv.corosol.classfile.constant.JConstantPool interface.
| Constructor Summary | |
|---|---|
DefaultJConstantPool()
Default constructor. |
|
| 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. |
JConstantPool |
getConstantPool()
Returns the constant pool of this classfile item. |
JConstant[] |
getConstants()
Returns an array containing all the constant pool entries. |
int |
length()
Returns the number of entries in this constant pool. |
void |
readItem(JClassFileInput in)
Extracts the data of this classfile item via the specified input stream. |
void |
setConstantPool(JConstantPool constantPool)
Sets the constant pool of this classfile item. |
java.lang.String |
toString()
Returns a string representation of this constant pool, containing the String representation of each entry. |
void |
writeItem(JClassFileOutput out)
Writes the data of this classfile part into a file via the specified output stream. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultJConstantPool()
| Method Detail |
|---|
public int addConstant(JConstant constant)
addConstant in interface JConstantPoolconstant - entry to be added to this constant pool
public int addConstantUtf8(java.lang.String string)
addConstantUtf8 in interface JConstantPoolstring - the string to be stored in the new entry
public int addConstantString(java.lang.String string)
addConstantString in interface JConstantPoolstring - the string to be stored in the new entry
public int addConstantClass(java.lang.String className)
addConstantClass in interface JConstantPoolclassName - a class name
public int addConstantFieldref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
addConstantFieldref in interface JConstantPoolclassName - the name of a classname - the name of the fielddesc - the descriptor of the field
public int addConstantMethodref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
addConstantMethodref in interface JConstantPoolclassName - the name of a classname - the name of the fielddesc - the descriptor of the field
public int addConstantInterfaceMethodref(java.lang.String className,
java.lang.String name,
java.lang.String desc)
addConstantInterfaceMethodref in interface JConstantPoolclassName - the name of a classname - the name of the interface methoddesc - the descriptor of the interface method
public int addConstantNameAndType(java.lang.String name,
java.lang.String descriptor)
addConstantNameAndType in interface JConstantPoolname - the name of a field or a methoddescriptor - the descriptor of a field or a method
public int addConstantInteger(int intValue)
addConstantInteger in interface JConstantPoolintValue - the value to be stored in the new entry
public int addConstantFloat(float floatValue)
addConstantFloat in interface JConstantPoolfloatValue - the value to be stored in the new entry
public int addConstantLong(long longValue)
addConstantLong in interface JConstantPoollongValue - the value to be stored in the new entry
public int addConstantDouble(double doubleValue)
addConstantDouble in interface JConstantPooldoubleValue - the value to be stored in the new entry
public int length()
length in interface JConstantPoolpublic JConstant getConstant(int index)
getConstant in interface JConstantPoolindex - index of entry to return
public JConstant[] getConstants()
getConstants in interface JConstantPoolpublic java.lang.String toString()
toString in interface JConstantPooltoString in class java.lang.Objectpublic JConstantPool getConstantPool()
getConstantPool in interface JClassFileItempublic void setConstantPool(JConstantPool constantPool)
setConstantPool in interface JClassFileItemconstantPool - the constant Pool
public void readItem(JClassFileInput in)
throws java.io.IOException
readItem in interface JClassFileItemin - a class file input stream
java.io.IOException - if an I/O error occurs when
reading this classfile item datas
public void writeItem(JClassFileOutput out)
throws java.io.IOException
writeItem in interface JClassFileItemout - a class file output stream
java.io.IOException - if an I/O error occurs when
writing into the classfile
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||