gnu.bytecode

Class ConstantPool

public class ConstantPool extends Object

Manages a pool of constants, as used in .class files and Java interpreters.
Field Summary
static byteCLASS
static byteDOUBLE
static byteFIELDREF
static byteFLOAT
static byteINTEGER
static byteINTERFACE_METHODREF
static byteLONG
static byteMETHODREF
static byteNAME_AND_TYPE
static byteSTRING
static byteUTF8
Constructor Summary
ConstantPool()
ConstantPool(DataInputStream dstr)
Method Summary
CpoolClassaddClass(ObjectType otype)
CpoolClassaddClass(String name)
CpoolClassaddClass(CpoolUtf8 name)
CpoolValue2addDouble(double val)
CpoolRefaddFieldRef(Field field)
CpoolValue1addFloat(float val)
CpoolValue1addInt(int val)
CpoolValue2addLong(long val)
CpoolRefaddMethodRef(Method method)
CpoolNameAndTypeaddNameAndType(Method method)
CpoolNameAndTypeaddNameAndType(Field field)
CpoolNameAndTypeaddNameAndType(CpoolUtf8 name, CpoolUtf8 type)
CpoolRefaddRef(int tag, CpoolClass clas, CpoolNameAndType nameAndType)
CpoolStringaddString(String string)
CpoolStringaddString(CpoolUtf8 str)
CpoolUtf8addUtf8(String s)
intgetCount()
CpoolEntrygetPoolEntry(int index)
Get the index'th entry in pool.

Field Detail

CLASS

public static final byte CLASS

DOUBLE

public static final byte DOUBLE

FIELDREF

public static final byte FIELDREF

FLOAT

public static final byte FLOAT

INTEGER

public static final byte INTEGER

INTERFACE_METHODREF

public static final byte INTERFACE_METHODREF

LONG

public static final byte LONG

METHODREF

public static final byte METHODREF

NAME_AND_TYPE

public static final byte NAME_AND_TYPE

STRING

public static final byte STRING

UTF8

public static final byte UTF8

Constructor Detail

ConstantPool

public ConstantPool()

ConstantPool

public ConstantPool(DataInputStream dstr)

Method Detail

addClass

public CpoolClass addClass(ObjectType otype)

addClass

public CpoolClass addClass(String name)

addClass

public CpoolClass addClass(CpoolUtf8 name)

addDouble

public CpoolValue2 addDouble(double val)

addFieldRef

public CpoolRef addFieldRef(Field field)

addFloat

public CpoolValue1 addFloat(float val)

addInt

public CpoolValue1 addInt(int val)

addLong

public CpoolValue2 addLong(long val)

addMethodRef

public CpoolRef addMethodRef(Method method)

addNameAndType

public CpoolNameAndType addNameAndType(Method method)

addNameAndType

public CpoolNameAndType addNameAndType(Field field)

addNameAndType

public CpoolNameAndType addNameAndType(CpoolUtf8 name, CpoolUtf8 type)

addRef

public CpoolRef addRef(int tag, CpoolClass clas, CpoolNameAndType nameAndType)

addString

public final CpoolString addString(String string)

addString

public CpoolString addString(CpoolUtf8 str)

addUtf8

public CpoolUtf8 addUtf8(String s)

getCount

public final int getCount()

getPoolEntry

public final CpoolEntry getPoolEntry(int index)
Get the index'th entry in pool. Will throw ArrayIndexOutOfBoundsException on an invalid index