public class ConstantPool extends Object implements Cloneable, Serializable
Constant
,
Serialized FormModifier and Type | Method and Description |
---|---|
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.
|
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.
|
String |
getConstantString(int index,
byte tag)
Get string from constant pool and bypass the indirection of
`ConstantClass' and `ConstantString' objects.
|
int |
getLength() |
String |
toString() |
public String constantToString(Constant c) throws ClassFormatException
c
- Constant to be printedClassFormatException
public String constantToString(int index, byte tag) throws ClassFormatException
index
- of constant in constant pooltag
- expected typeClassFormatException
public Constant getConstant(int index)
index
- Index in constant poolConstant
public Constant getConstant(int index, byte tag) throws ClassFormatException
index
- Index in constant pooltag
- Tag of expected constant, i.e., its typeClassFormatException
Constant
public String getConstantString(int index, byte tag) throws ClassFormatException
index
- Index in constant pooltag
- Tag of expected constant, either ConstantClass or ConstantStringClassFormatException
ConstantClass
,
ConstantString
public int getLength()
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.