Package jminusminus
Class CLConstantPool
java.lang.Object
jminusminus.CLConstantPool
Representation of a class' constant pool.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintAdds the specified (non-null) item to the constant pool and returns its index.intconstantClassInfo(String className) Returns the constant pool index of a singleton instance of CLConstantClassInfo.intconstantDoubleInfo(double d) Returns the constant pool index of a singleton instance of CLConstantDoubleInfo.intconstantFieldRefInfo(String className, String name, String type) Returns the constant pool index of a singleton instance of CLConstantFieldRefInfo.intconstantFloatInfo(float f) Returns the constant pool index of a singleton instance of CLConstantFloatInfo.intconstantIntegerInfo(int i) Returns the constant pool index of a singleton instance of CLConstantIntegerInfo.intconstantInterfaceMethodRefInfo(String className, String name, String type) Returns the constant pool index of a singleton instance of CLConstantInterfaceMethodRefInfo.intconstantLongInfo(long l) Returns the constant pool index of a singleton instance of CLConstantLongInfo.intconstantMethodRefInfo(String className, String name, String type) Returns the constant pool index of a singleton instance of CLConstantMethodRefInfo.intconstantNameAndTypeInfo(String name, String type) Returns the constant pool index of a singleton instance of CLConstantNameAndTypeInfo.intReturns the constant pool index of a singleton instance of CLConstantStringInfo.intReturns the constant pool index of a singleton instance of CLConstantUtf8Info.cpItem(int i) Returns the constant pool item at the specified index or null.intReturns the index of the specified item in the constant pool or -1.intsize()Returns the size of the constant pool.voidwrite(CLOutputStream out) Writes the contents of the constant pool to the specified output stream.
- 
Constructor Details- 
CLConstantPoolpublic CLConstantPool()Constructs an empty constant pool.
 
- 
- 
Method Details- 
sizepublic int size()Returns the size of the constant pool.- Returns:
- the size of the constant pool.
 
- 
findReturns the index of the specified item in the constant pool or -1.- Parameters:
- cpInfo- item to find.
- Returns:
- the index of the specified item in the constant pool or -1.
 
- 
cpItemReturns the constant pool item at the specified index or null.- Parameters:
- i- constant pool index.
- Returns:
- the constant pool item at the specified index or null.
 
- 
addCPItemAdds the specified (non-null) item to the constant pool and returns its index.- Parameters:
- cpInfo- the item to add.
- Returns:
- constant pool index of the item.
 
- 
writeWrites the contents of the constant pool to the specified output stream.- Parameters:
- out- output stream.
- Throws:
- IOException- if an error occurs while writing.
 
- 
constantClassInfoReturns the constant pool index of a singleton instance of CLConstantClassInfo.- Parameters:
- className- class or interface name in internal form.
- Returns:
- constant pool index.
 
- 
constantFieldRefInfoReturns the constant pool index of a singleton instance of CLConstantFieldRefInfo.- Parameters:
- className- class or interface name in internal form.
- name- name of the field.
- type- descriptor of the field.
- Returns:
- constant pool index.
 
- 
constantMethodRefInfoReturns the constant pool index of a singleton instance of CLConstantMethodRefInfo.- Parameters:
- className- class or interface name in internal form.
- name- name of the method.
- type- descriptor of the method.
- Returns:
- constant pool index.
 
- 
constantInterfaceMethodRefInfoReturns the constant pool index of a singleton instance of CLConstantInterfaceMethodRefInfo.- Parameters:
- className- class or interface name in internal form.
- name- name of the method.
- type- descriptor of the method.
- Returns:
- constant pool index.
 
- 
constantStringInfoReturns the constant pool index of a singleton instance of CLConstantStringInfo.- Parameters:
- s- the constant string value.
- Returns:
- constant pool index.
 
- 
constantIntegerInfopublic int constantIntegerInfo(int i) Returns the constant pool index of a singleton instance of CLConstantIntegerInfo.- Parameters:
- i- the constant int value.
- Returns:
- constant pool index.
 
- 
constantFloatInfopublic int constantFloatInfo(float f) Returns the constant pool index of a singleton instance of CLConstantFloatInfo.- Parameters:
- f- the constant floating-point value.
- Returns:
- constant pool index.
 
- 
constantLongInfopublic int constantLongInfo(long l) Returns the constant pool index of a singleton instance of CLConstantLongInfo.- Parameters:
- l- the constant long value.
- Returns:
- constant pool index.
 
- 
constantDoubleInfopublic int constantDoubleInfo(double d) Returns the constant pool index of a singleton instance of CLConstantDoubleInfo.- Parameters:
- d- the constant double value.
- Returns:
- constant pool index.
 
- 
constantNameAndTypeInfoReturns the constant pool index of a singleton instance of CLConstantNameAndTypeInfo.- Parameters:
- name- field or method name.
- type- field or method type descriptor.
- Returns:
- constant pool index.
 
- 
constantUtf8InfoReturns the constant pool index of a singleton instance of CLConstantUtf8Info.- Parameters:
- s- the constant string value.
- Returns:
- constant pool index.
 
 
-