|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--javar.constantpool.ConstantPool
This class represents the constant pool of a java class file
| Constructor Summary | |
ConstantPool()
Default Constructor |
|
ConstantPool(DataInputStream in)
Default Constructor |
|
| Method Summary | |
long |
addClass(String className)
This will add an entry to the constant pool |
long |
addMethod(String className,
String name,
String type)
This will add a new method to the pool |
long |
addNameAndType(String name,
String type)
This will add a name and type entry to the pool |
long |
addString(String entry)
This will add an entry to the constant pool. |
long |
addUTF8(String entry)
This will add an entry to the constant pool. |
long |
findUTF8(String string)
This will find the index to the string, or -1 if it was not found. |
ConstantPoolEntry |
getEntry(long index)
This will get an entry in the pool for you |
long |
getSize()
This will return the number of entries that are contained |
boolean |
isReady(long index)
This will tell you if the selected entry is ready to be read. |
Iterator |
listEntriesByType(byte code)
This will get all entries in the constant pool based on a specific type. |
byte[] |
toBytes()
This will get the constant pool as a set of bytes that are needed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConstantPool()
public ConstantPool(DataInputStream in)
throws JavarParseException
| Method Detail |
public Iterator listEntriesByType(byte code)
code - The type code used to search for entries.public long getSize()
public ConstantPoolEntry getEntry(long index)
public boolean isReady(long index)
index - The constant pool index
public byte[] toBytes()
throws JavarIOException
JavarIOExceptionpublic long addString(String entry)
public long addUTF8(String entry)
public long findUTF8(String string)
string - The string to find
public long addClass(String className)
className - The name of the class to add.
public long addNameAndType(String name,
String type)
name - The nametype - Thee type
public long addMethod(String className,
String name,
String type)
className - The name of the classname - The name of the methodtype - Descriptor of the method
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||