class CLConstantPool extends Object
Constructor and Description |
---|
CLConstantPool()
Construct a CLConstantPool object.
|
Modifier and Type | Method and Description |
---|---|
int |
addCPItem(CLCPInfo cpInfo)
Add the specified (non null) item to the constant pool table and return
its index.
|
int |
constantClassInfo(String s)
Return the constant pool index of a singleton instance of
CLConstantClassInfo.
|
int |
constantDoubleInfo(double d)
Return the constant pool index of a singleton instance of
CLConstantDoubleInfo.
|
int |
constantFieldRefInfo(String className,
String name,
String type)
Return the constant pool index of a singleton instance of
CLConstantFieldRefInfo.
|
int |
constantFloatInfo(float f)
Return the constant pool index of a singleton instance of
CLConstantFloatInfo.
|
int |
constantIntegerInfo(int i)
Return the constant pool index of a singleton instance of
CLConstantIntegerInfo.
|
int |
constantInterfaceMethodRefInfo(String className,
String name,
String type)
Return the constant pool index of a singleton instance of
CLConstantInterfaceMethodRefInfo.
|
int |
constantLongInfo(long l)
Return the constant pool index of a singleton instance of
CLConstantLongInfo.
|
int |
constantMethodRefInfo(String className,
String name,
String type)
Return the constant pool index of a singleton instance of
CLConstantMethodRefInfo.
|
int |
constantNameAndTypeInfo(String name,
String type)
Return the constant pool index of a singleton instance of
CLConstantNameAndTypeInfo.
|
int |
constantStringInfo(String s)
Return the constant pool index of a singleton instance of
CLConstantStringInfo.
|
int |
constantUtf8Info(String s)
Return the constant pool index of a singleton instance of
CLConstantUtf8Info.
|
CLCPInfo |
cpItem(int i)
Return the constant pool item at the specified index, or null if the
index is invalid.
|
int |
find(CLCPInfo cpInfo)
Return the constant pool index of the specified item if it exists in the
pool, -1 otherwise.
|
int |
size()
Return the size of the constant pool.
|
void |
write(CLOutputStream out)
Write the contents of the constant_pool to the specified output stream.
|
void |
writeToStdOut(PrettyPrinter p)
Write the contents of the constant pool to STDOUT in a format similar to
that of javap.
|
public int size()
public int find(CLCPInfo cpInfo)
cpInfo
- item to find.public CLCPInfo cpItem(int i)
i
- constant pool index.public int addCPItem(CLCPInfo cpInfo)
cpInfo
- the item to add to the constant pool table.public void write(CLOutputStream out) throws IOException
out
- output stream.IOException
- if an error occurs while writing.public void writeToStdOut(PrettyPrinter p)
p
- for pretty printing with indentation.public int constantClassInfo(String s)
s
- class or interface name in internal form.public int constantFieldRefInfo(String className, String name, String type)
className
- class or interface name in internal form.name
- name of the field.type
- descriptor of the field.public int constantMethodRefInfo(String className, String name, String type)
className
- class or interface name in internal form.name
- name of the method.type
- descriptor of the method.public int constantInterfaceMethodRefInfo(String className, String name, String type)
className
- class or interface name in internal form.name
- name of the method.type
- descriptor of the method.public int constantStringInfo(String s)
s
- the constant string value.public int constantIntegerInfo(int i)
i
- the constant int value.public int constantFloatInfo(float f)
f
- the constant floating-point value.public int constantLongInfo(long l)
l
- the constant long value.public int constantDoubleInfo(double d)
d
- the constant double value.public int constantNameAndTypeInfo(String name, String type)
name
- field or method name.type
- field or method type descriptor.public int constantUtf8Info(String s)
s
- the constant string value.