All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.ClassFile.HCode

java.lang.Object
   |
   +----harpoon.ClassFile.HCode

public abstract class HCode
extends Object
HCode is an abstract class that all views of a particular method's executable code should extend.

An HCode corresponds roughly to a "list of instructions".

Version:
$Id: HCode.java,v 1.12 1998/11/10 03:31:38 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
HMethod, HCodeElement, Code, Instr

Constructor Index

 o HCode()

Method Index

 o clone(HMethod)
Clone this HCode, possibly moving it to a different method.
 o getElements()
Return an ordered list of the component objects making up this code view.
 o getElementsE()
Return an Enumeration of the component objects making up this code view.
 o getLeafElements()
Return the 'leaves' of this code view; that is, the elements with no successors.
 o getMethod()
Return the HMethod to which this HCode belongs.
 o getName()
Return the name of this code view.
 o getRootElement()
Return the 'root' element of this code view.
 o print(PrintWriter)
Pretty-print this code view.
 o toString()
Returns a human-readable representation of this HCode.

Constructors

 o HCode
 public HCode()

Methods

 o getMethod
 public abstract HMethod getMethod()
Return the HMethod to which this HCode belongs.

 o getName
 public abstract String getName()
Return the name of this code view. The default bytecode view is named "bytecode". It is suggested that additional views be named in a similarly human-friendly fashion.

 o getElements
 public abstract HCodeElement[] getElements()
Return an ordered list of the component objects making up this code view. If there is a 'root' to the code view, it should occupy index 0 of the HCodeElement array.

See Also:
Instr
 o getElementsE
 public abstract Enumeration getElementsE()
Return an Enumeration of the component objects making up this code view. If there is a 'root' to the code view, it should be the first element enumerated.

See Also:
Instr
 o getRootElement
 public HCodeElement getRootElement()
Return the 'root' element of this code view.

Returns:
root of the code view, or null if this notion is not applicable.
 o getLeafElements
 public HCodeElement[] getLeafElements()
Return the 'leaves' of this code view; that is, the elements with no successors.

Returns:
leaves of the code view, or null if this notion is not applicable.
 o clone
 public HCode clone(HMethod newMethod) throws CloneNotSupportedException
Clone this HCode, possibly moving it to a different method. Throws CloneNotSupportedException if not overridden.

Throws: CloneNotSupportedException
if it is not possible to clone this HCode.
 o print
 public void print(PrintWriter pw)
Pretty-print this code view.

 o toString
 public String toString()
Returns a human-readable representation of this HCode.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index