|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.IR.RawClass.Constant
public abstract class Constant
The Constant
class represents a single item in
the constant pool of a class file. It is a super-class for the
various specific constant pool item types.
Drawn from The Java Virtual Machine Specification.
ConstantUtf8
,
ConstantInteger
,
ConstantFloat
,
ConstantLong
,
ConstantDouble
,
ConstantClass
,
ConstantString
,
ConstantFieldref
,
ConstantMethodref
,
ConstantInterfaceMethodref
,
ConstantNameAndType
Field Summary | |
---|---|
protected ClassFile |
parent
ClassFile in which this Constant is found. |
Constructor Summary | |
---|---|
protected |
Constant(ClassFile parent)
|
Method Summary | |
---|---|
int |
entrySize()
|
void |
print(PrintWriter pw,
int indent)
Pretty-print this constant. |
static Constant |
read(ClassFile p,
ClassDataInputStream in)
Read a single Constant item from an input class bytecode file, and return an object instance corresponding to it. |
String |
toString()
Create a human-readable representation for the Constant. |
abstract void |
write(ClassDataOutputStream out)
Write a single constant pool item to a class bytecode file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ClassFile parent
Constructor Detail |
---|
protected Constant(ClassFile parent)
Method Detail |
---|
public int entrySize()
public static Constant read(ClassFile p, ClassDataInputStream in) throws IOException
IOException
- on error reading from input stream.public abstract void write(ClassDataOutputStream out) throws IOException
IOException
- on error writing to output stream.public String toString()
toString
in class Object
public void print(PrintWriter pw, int indent)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |