harpoon.Analysis
Class AllCallers

java.lang.Object
  extended by harpoon.Analysis.AllCallers

public class AllCallers
extends Object

AllCallers calculates the transitive closure of the dual of the call graph for methods that fulfill a certain condition.

Version:
$Id: AllCallers.java,v 1.5 2004/02/08 03:19:12 cananian Exp $
Author:
Karen K. Zee <kkz@alum.mit.edu>

Nested Class Summary
static interface AllCallers.MethodSet
          MethodSet defines the interface whose method select is used in getCallers as a predicate.
 
Constructor Summary
AllCallers(CallGraph cg)
          Creates an AllCallers object that is the dual of the callgraph cg (of type harpoon.Analysis.Quads.CallGraoh).
AllCallers(ClassHierarchy ch, HCodeFactory hcf)
          Creates an AllCallers object using the specified ClassHierarchy.
 
Method Summary
 HMethod[] directCallers(HMethod hm)
          Returns all the direct callers of the hm method.
 Set directCallerSet(HMethod hm)
          Returns all the direct callers of the hm method.
 Set getCallers(AllCallers.MethodSet ms)
          getCallers returns a Set that contains all indirect and direct callers of callable methods that fulfill the predicate in the select method of ms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllCallers

public AllCallers(ClassHierarchy ch,
                  HCodeFactory hcf)
Creates an AllCallers object using the specified ClassHierarchy. Currently, hcf must be a code factory that generates quad-no-ssa or quad-ssi form because the dual of the call graph is built using CallGraph.


AllCallers

public AllCallers(CallGraph cg)
Creates an AllCallers object that is the dual of the callgraph cg (of type harpoon.Analysis.Quads.CallGraoh).

Method Detail

getCallers

public Set getCallers(AllCallers.MethodSet ms)
getCallers returns a Set that contains all indirect and direct callers of callable methods that fulfill the predicate in the select method of ms.


directCallers

public HMethod[] directCallers(HMethod hm)
Returns all the direct callers of the hm method.


directCallerSet

public Set directCallerSet(HMethod hm)
Returns all the direct callers of the hm method.