All Packages Class Hierarchy This Package Previous Next Index
Class harpoon.ClassFile.Raw.Constant.Constant
java.lang.Object
|
+----harpoon.ClassFile.Raw.Constant.Constant
- public abstract class Constant
- extends Object
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.
- Version:
- $Id: Constant.java,v 1.12 1998/10/11 03:01:14 cananian Exp $
- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>
- See Also:
- ConstantUtf8, ConstantInteger, ConstantFloat, ConstantLong, ConstantDouble, ConstantClass, ConstantString, ConstantFieldref, ConstantMethodref, ConstantInterfaceMethodref, ConstantNameAndType
-
parent
- ClassFile in which this Constant is found.
-
Constant(ClassFile)
-
-
print(PrintWriter, int)
- Pretty-print this constant.
-
read(ClassFile, ClassDataInputStream)
- Read a single Constant item from an input class bytecode file,
and return an object instance corresponding to it.
-
toString()
- Create a human-readable representation for the Constant.
-
write(ClassDataOutputStream)
- Write a single constant pool item to a class bytecode file.
parent
protected ClassFile parent
- ClassFile in which this Constant is found.
Constant
protected Constant(ClassFile parent)
read
public static Constant read(ClassFile p,
ClassDataInputStream in) throws IOException
- Read a single Constant item from an input class bytecode file,
and return an object instance corresponding to it.
- Throws: IOException
- on error reading from input stream.
write
public abstract void write(ClassDataOutputStream out) throws IOException
- Write a single constant pool item to a class bytecode file.
- Throws: IOException
- on error writing to output stream.
toString
public String toString()
- Create a human-readable representation for the Constant.
- Overrides:
- toString in class Object
print
public void print(PrintWriter pw,
int indent)
- Pretty-print this constant.
All Packages Class Hierarchy This Package Previous Next Index