| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class represents the constant pool, i.e. a table of constants. It may contain null references, due to the JVM specification that skips an entry after an 8-byte constant (double, long) entry.
Constructor Summary | |
| ConstantPool(Constant[] constant_pool) |
(package private) | ConstantPool(DataInputStream file) Read constants from given file stream. |
Method Summary | |
void | accept(Visitor v) Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. |
String | constantToString(Constant c) Resolve constant to a string representation. |
String | constantToString(int index, byte tag) Retrieve constant at `index' from constant pool and resolve it to a string representation. |
void | dump(DataOutputStream file) Dump constant pool to file stream in binary format. |
final Constant | getConstant(int index) Get constant from constant pool. |
final Constant | getConstant(int index, byte tag) Get constant from constant pool and check whether it has the expected type. |
final Constant[] | getConstantPool() |
final String | getConstantString(int index, byte tag) Get string from constant pool and bypass the indirection of `ConstantClass' and `ConstantString' objects. |
final int | getLength() |
final void | setConstant(int index, Constant constant) |
final void | setConstantPool(Constant[] constant_pool) |
final String | toString() |
Constructor Detail |
public ConstantPool(Constant[] constant_pool)
ConstantPool(DataInputStream file)
throws java.io.IOException,
java.lang.ClassFormatError
Method Detail |
public void accept(Visitor v)
public String constantToString(Constant c)
throws java.lang.ClassFormatError
public String constantToString(int index, byte tag)
throws java.lang.ClassFormatError
public void dump(DataOutputStream file)
throws java.io.IOException
public final Constant getConstant(int index)
public final Constant getConstant(int index, byte tag)
throws java.lang.ClassFormatError
public final Constant[] getConstantPool()
public final String getConstantString(int index, byte tag)
throws java.lang.ClassFormatError
public final int getLength()
public final void setConstant(int index, Constant constant)
public final void setConstantPool(Constant[] constant_pool)
public final String toString()
Association Links |
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |