public class ConstantPool
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Constant,
Serialized Form| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
constantToString(Constant c)
Resolve constant to a string representation.
|
java.lang.String |
constantToString(int index,
byte tag)
Retrieve constant at `index' from constant pool and resolve it to
a string representation.
|
Constant |
getConstant(int index)
Get constant from constant pool.
|
Constant |
getConstant(int index,
byte tag)
Get constant from constant pool and check whether it has the
expected type.
|
java.lang.String |
getConstantString(int index,
byte tag)
Get string from constant pool and bypass the indirection of
`ConstantClass' and `ConstantString' objects.
|
int |
getLength() |
java.lang.String |
toString() |
public java.lang.String constantToString(Constant c) throws ClassFormatException
c - Constant to be printedClassFormatExceptionpublic java.lang.String constantToString(int index,
byte tag)
throws ClassFormatException
index - of constant in constant pooltag - expected typeClassFormatExceptionpublic Constant getConstant(int index)
index - Index in constant poolConstantpublic Constant getConstant(int index, byte tag) throws ClassFormatException
index - Index in constant pooltag - Tag of expected constant, i.e., its typeClassFormatExceptionConstantpublic java.lang.String getConstantString(int index,
byte tag)
throws ClassFormatException
index - Index in constant pooltag - Tag of expected constant, either ConstantClass or ConstantStringClassFormatExceptionConstantClass,
ConstantStringpublic int getLength()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.