gnu.bytecode
Class ConstantPool
java.lang.Object
gnu.bytecode.ConstantPool
public class ConstantPool
- extends java.lang.Object
Manages a pool of constants, as used in .class files and Java interpreters.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLASS
public static final byte CLASS
- See Also:
- Constant Field Values
FIELDREF
public static final byte FIELDREF
- See Also:
- Constant Field Values
METHODREF
public static final byte METHODREF
- See Also:
- Constant Field Values
INTERFACE_METHODREF
public static final byte INTERFACE_METHODREF
- See Also:
- Constant Field Values
STRING
public static final byte STRING
- See Also:
- Constant Field Values
INTEGER
public static final byte INTEGER
- See Also:
- Constant Field Values
FLOAT
public static final byte FLOAT
- See Also:
- Constant Field Values
LONG
public static final byte LONG
- See Also:
- Constant Field Values
DOUBLE
public static final byte DOUBLE
- See Also:
- Constant Field Values
NAME_AND_TYPE
public static final byte NAME_AND_TYPE
- See Also:
- Constant Field Values
UTF8
public static final byte UTF8
- See Also:
- Constant Field Values
ConstantPool
public ConstantPool()
ConstantPool
public ConstantPool(java.io.DataInputStream dstr)
throws java.io.IOException
- Throws:
java.io.IOException
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
addUtf8
public CpoolUtf8 addUtf8(java.lang.String s)
addClass
public CpoolClass addClass(ObjectType otype)
addClass
public CpoolClass addClass(java.lang.String name)
addClass
public CpoolClass addClass(CpoolUtf8 name)
addInt
public CpoolValue1 addInt(int val)
addLong
public CpoolValue2 addLong(long val)
addFloat
public CpoolValue1 addFloat(float val)
addDouble
public CpoolValue2 addDouble(double val)
addString
public final CpoolString addString(java.lang.String string)
addString
public CpoolString addString(CpoolUtf8 str)
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)
addMethodRef
public CpoolRef addMethodRef(Method method)
addFieldRef
public CpoolRef addFieldRef(Field field)