harpoon.Analysis.Quads
Class QuadClassHierarchy

java.lang.Object
  |
  +--harpoon.Analysis.ClassHierarchy
        |
        +--harpoon.Analysis.Quads.QuadClassHierarchy
All Implemented Interfaces:
Serializable

public class QuadClassHierarchy
extends ClassHierarchy
implements Serializable

QuadClassHierarchy computes a ClassHierarchy of classes possibly usable starting from some root method using quad form. Native methods are not analyzed.

Version:
$Id: QuadClassHierarchy.java,v 1.3 2002/02/26 22:41:42 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Constructor Summary
QuadClassHierarchy(Linker linker, Collection roots, HCodeFactory hcf)
          Creates a ClassHierarchy of all classes reachable/usable from HMethods in the roots Collection.
 
Method Summary
 Set callableMethods()
          Returns set of all callable methods.
 Set children(HClass c)
          Returns all usable/reachable children of an HClass.
 Set classes()
          Returns the set of all reachable/usable classes.
 Set instantiatedClasses()
          Returns the set of all classes instantiated.
 String toString()
          Returns a human-readable representation of the hierarchy.
 
Methods inherited from class harpoon.Analysis.ClassHierarchy
overrides, overrides, parents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuadClassHierarchy

public QuadClassHierarchy(Linker linker,
                          Collection roots,
                          HCodeFactory hcf)
Creates a ClassHierarchy of all classes reachable/usable from HMethods in the roots Collection. HClasses included in roots are guaranteed to be included in the classes() set of this class hierarchy, but they may not be included in the instantiatedClasses set (if an instantiation instruction is not found for them). To explicitly include an instantiated class in the hierarchy, add a constructor or non-static method of that class to the roots Collection.

hcf must be a code factory that generates quad form.

Method Detail

callableMethods

public Set callableMethods()
Returns set of all callable methods.

Specified by:
callableMethods in class ClassHierarchy
Returns:
Set of HMethods.

children

public Set children(HClass c)
Description copied from class: ClassHierarchy
Returns all usable/reachable children of an HClass. For an interface class c, the children include all reachable classes which implement it as well as any reachable interfaces which extend it. For a non-interface class, children are all reachable subclasses.

Specified by:
children in class ClassHierarchy
Returns:
Set of HClasses.

classes

public Set classes()
Description copied from class: ClassHierarchy
Returns the set of all reachable/usable classes. If any method in a class is callable (including static methods), then the class will be a member of the returned set.

Specified by:
classes in class ClassHierarchy
Returns:
Set of HClasses.

instantiatedClasses

public Set instantiatedClasses()
Returns the set of all classes instantiated. (Actually only the list of classes for which an explicit NEW is found; should include list of classes that are automatically created by JVM!)

Specified by:
instantiatedClasses in class ClassHierarchy

toString

public String toString()
Returns a human-readable representation of the hierarchy.

Overrides:
toString in class Object