Package gnu.bytecode
Class ConstantPool
java.lang.Object
gnu.bytecode.ConstantPool
Manages a pool of constants, as used in .class files and Java interpreters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
Any one of the XXX_REF types.static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddClass
(ObjectType otype) addDouble
(double val) addFieldRef
(Field field) addFloat
(float val) addInt
(int val) addLong
(long val) addMethodHandle
(int kind, CpoolRef reference) addMethodHandle
(Method method) addMethodRef
(Method method) addNameAndType
(CpoolUtf8 name, CpoolUtf8 type) addNameAndType
(Field field) addNameAndType
(Method method) addRef
(int tag, CpoolClass clas, CpoolNameAndType nameAndType) final CpoolString
final int
getCount()
final CpoolEntry
getPoolEntry
(int index) Get the index'th entry in pool.
-
Field Details
-
CLASS
public static final byte CLASS- See Also:
-
FIELDREF
public static final byte FIELDREF- See Also:
-
METHODREF
public static final byte METHODREF- See Also:
-
INTERFACE_METHODREF
public static final byte INTERFACE_METHODREF- See Also:
-
ANY_REF
public static final byte ANY_REFAny one of the XXX_REF types.- See Also:
-
STRING
public static final byte STRING- See Also:
-
INTEGER
public static final byte INTEGER- See Also:
-
FLOAT
public static final byte FLOAT- See Also:
-
LONG
public static final byte LONG- See Also:
-
DOUBLE
public static final byte DOUBLE- See Also:
-
METHOD_HANDLE
public static final byte METHOD_HANDLE- See Also:
-
METHOD_TYPE
public static final byte METHOD_TYPE- See Also:
-
INVOKE_DYNAMIC
public static final byte INVOKE_DYNAMIC- See Also:
-
NAME_AND_TYPE
public static final byte NAME_AND_TYPE- See Also:
-
UTF8
public static final byte UTF8- See Also:
-
-
Constructor Details
-
ConstantPool
public ConstantPool() -
ConstantPool
- Throws:
IOException
-
-
Method Details
-
getCount
public final int getCount() -
getPoolEntry
Get the index'th entry in pool. Will throw ArrayIndexOutOfBoundsException on an invalid index -
addUtf8
-
addClass
-
addMethodHandle
-
addMethodHandle
-
addClass
-
addInt
-
addLong
-
addFloat
-
addDouble
-
addString
-
addString
-
addNameAndType
-
addNameAndType
-
addNameAndType
-
addRef
-
addMethodRef
-
addFieldRef
-