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

Variable Index

 o parent
ClassFile in which this Constant is found.

Constructor Index

 o Constant(ClassFile)

Method Index

 o print(PrintWriter, int)
Pretty-print this constant.
 o read(ClassFile, ClassDataInputStream)
Read a single Constant item from an input class bytecode file, and return an object instance corresponding to it.
 o toString()
Create a human-readable representation for the Constant.
 o write(ClassDataOutputStream)
Write a single constant pool item to a class bytecode file.

Variables

 o parent
 protected ClassFile parent
ClassFile in which this Constant is found.

Constructors

 o Constant
 protected Constant(ClassFile parent)

Methods

 o 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.
 o 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.
 o toString
 public String toString()
Create a human-readable representation for the Constant.

Overrides:
toString in class Object
 o print
 public void print(PrintWriter pw,
                   int indent)
Pretty-print this constant.


All Packages  Class Hierarchy  This Package  Previous  Next  Index