soot
Class Hierarchy

java.lang.Object
  |
  +--soot.Hierarchy

public class Hierarchy
extends java.lang.Object

Represents the class hierarchy. It is closely linked to a Scene, and must be recreated if the Scene changes. The general convention is that if a method name contains "Including", then it returns the non-strict result; otherwise, it does a strict query (e.g. strict superclass).


Constructor Summary
Hierarchy()
          Constructs a hierarchy from the current scene.
 
Method Summary
 java.util.List getDirectImplementersOf(SootClass i)
          Returns a list of direct implementers of c, excluding itself.
 java.util.List getDirectSubclassesOf(SootClass c)
          Returns a list of direct subclasses of c, excluding c.
 java.util.List getDirectSubclassesOfIncluding(SootClass c)
          Returns a list of direct subclasses of c, including c.
 java.util.List getDirectSubinterfacesOf(SootClass c)
          Returns a list of direct subinterfaces of c.
 java.util.List getDirectSubinterfacesOfIncluding(SootClass c)
          Returns a list of direct subinterfaces of c, including itself.
 java.util.List getDirectSuperclassesOf(SootClass c)
          Returns a list of direct superclasses of c, excluding c.
 java.util.List getDirectSuperinterfacesOf(SootClass c)
          Returns a list of direct superinterfaces of c.
 java.util.List getImplementersOf(SootClass i)
          Returns a list of implementers of c, excluding itself.
 SootClass getLeastCommonSuperclassOf(SootClass c1, SootClass c2)
          Returns the most specific type which is an ancestor of both c1 and c2.
 java.util.List getSubclassesOf(SootClass c)
          Returns a list of subclasses of c, excluding itself.
 java.util.List getSubclassesOfIncluding(SootClass c)
          Returns a list of subclasses of c, including itself.
 java.util.List getSubinterfacesOf(SootClass c)
          Returns a list of subinterfaces of c, excluding itself.
 java.util.List getSubinterfacesOfIncluding(SootClass c)
          Returns a list of subinterfaces of c, including itself.
 java.util.List getSuperclassesOf(SootClass c)
          Returns a list of strict superclasses of c, starting with c's parent.
 java.util.List getSuperclassesOfIncluding(SootClass c)
          Returns a list of superclasses of c, including itself.
 java.util.List getSuperinterfacesOf(SootClass c)
          Returns a list of superinterfaces of c, excluding itself.
 boolean isClassDirectSubclassOf(SootClass c, SootClass c2)
          Returns true if child is a direct subclass of possibleParent.
 boolean isClassSubclassOf(SootClass child, SootClass possibleParent)
          Returns true if child is a subclass of possibleParent.
 boolean isClassSubclassOfIncluding(SootClass child, SootClass possibleParent)
          Returns true if child is, or is a subclass of, possibleParent.
 boolean isClassSuperclassOf(SootClass parent, SootClass possibleChild)
          Returns true if child is a superclass of possibleParent.
 boolean isClassSuperclassOfIncluding(SootClass parent, SootClass possibleChild)
          Returns true if parent is, or is a superclass of, possibleChild.
 boolean isInterfaceDirectSubinterfaceOf(SootClass child, SootClass possibleParent)
          Returns true if child is a direct subinterface of possibleParent.
 boolean isInterfaceSubinterfaceOf(SootClass child, SootClass possibleParent)
          Returns true if child is a subinterface of possibleParent.
 java.util.List resolveAbstractDispatch(java.util.List classes, SootMethod m)
          Returns a list of possible targets for the given method and set of receiver types.
 java.util.List resolveAbstractDispatch(SootClass c, SootMethod m)
          Given an abstract dispatch to an object of type c and a method m, gives a list of possible receiver methods.
 java.util.List resolveConcreteDispatch(java.util.List classes, SootMethod m)
          Given a set of definite receiver types, returns a list of possible targets.
 SootMethod resolveConcreteDispatch(SootClass concreteType, SootMethod m)
          Given an object of actual type C (o = new C()), returns the method which will be called on an o.f() invocation.
 SootMethod resolveSpecialDispatch(SpecialInvokeExpr ie, SootMethod container)
          Returns the target for the given SpecialInvokeExpr.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hierarchy

public Hierarchy()
Constructs a hierarchy from the current scene.

Method Detail

getSubclassesOfIncluding

public java.util.List getSubclassesOfIncluding(SootClass c)
Returns a list of subclasses of c, including itself.


getSubclassesOf

public java.util.List getSubclassesOf(SootClass c)
Returns a list of subclasses of c, excluding itself.


getSuperclassesOfIncluding

public java.util.List getSuperclassesOfIncluding(SootClass c)
Returns a list of superclasses of c, including itself.


getSuperclassesOf

public java.util.List getSuperclassesOf(SootClass c)
Returns a list of strict superclasses of c, starting with c's parent.


getSubinterfacesOfIncluding

public java.util.List getSubinterfacesOfIncluding(SootClass c)
Returns a list of subinterfaces of c, including itself.


getSubinterfacesOf

public java.util.List getSubinterfacesOf(SootClass c)
Returns a list of subinterfaces of c, excluding itself.


getSuperinterfacesOf

public java.util.List getSuperinterfacesOf(SootClass c)
Returns a list of superinterfaces of c, excluding itself.


getDirectSuperclassesOf

public java.util.List getDirectSuperclassesOf(SootClass c)
Returns a list of direct superclasses of c, excluding c.


getDirectSubclassesOf

public java.util.List getDirectSubclassesOf(SootClass c)
Returns a list of direct subclasses of c, excluding c.


getDirectSubclassesOfIncluding

public java.util.List getDirectSubclassesOfIncluding(SootClass c)
Returns a list of direct subclasses of c, including c.


getDirectSuperinterfacesOf

public java.util.List getDirectSuperinterfacesOf(SootClass c)
Returns a list of direct superinterfaces of c.


getDirectSubinterfacesOf

public java.util.List getDirectSubinterfacesOf(SootClass c)
Returns a list of direct subinterfaces of c.


getDirectSubinterfacesOfIncluding

public java.util.List getDirectSubinterfacesOfIncluding(SootClass c)
Returns a list of direct subinterfaces of c, including itself.


getDirectImplementersOf

public java.util.List getDirectImplementersOf(SootClass i)
Returns a list of direct implementers of c, excluding itself.


getImplementersOf

public java.util.List getImplementersOf(SootClass i)
Returns a list of implementers of c, excluding itself.


isClassSubclassOf

public boolean isClassSubclassOf(SootClass child,
                                 SootClass possibleParent)
Returns true if child is a subclass of possibleParent.


isClassSubclassOfIncluding

public boolean isClassSubclassOfIncluding(SootClass child,
                                          SootClass possibleParent)
Returns true if child is, or is a subclass of, possibleParent.


isClassDirectSubclassOf

public boolean isClassDirectSubclassOf(SootClass c,
                                       SootClass c2)
Returns true if child is a direct subclass of possibleParent.


isClassSuperclassOf

public boolean isClassSuperclassOf(SootClass parent,
                                   SootClass possibleChild)
Returns true if child is a superclass of possibleParent.


isClassSuperclassOfIncluding

public boolean isClassSuperclassOfIncluding(SootClass parent,
                                            SootClass possibleChild)
Returns true if parent is, or is a superclass of, possibleChild.


isInterfaceSubinterfaceOf

public boolean isInterfaceSubinterfaceOf(SootClass child,
                                         SootClass possibleParent)
Returns true if child is a subinterface of possibleParent.


isInterfaceDirectSubinterfaceOf

public boolean isInterfaceDirectSubinterfaceOf(SootClass child,
                                               SootClass possibleParent)
Returns true if child is a direct subinterface of possibleParent.


getLeastCommonSuperclassOf

public SootClass getLeastCommonSuperclassOf(SootClass c1,
                                            SootClass c2)
Returns the most specific type which is an ancestor of both c1 and c2.


resolveConcreteDispatch

public SootMethod resolveConcreteDispatch(SootClass concreteType,
                                          SootMethod m)
Given an object of actual type C (o = new C()), returns the method which will be called on an o.f() invocation.


resolveConcreteDispatch

public java.util.List resolveConcreteDispatch(java.util.List classes,
                                              SootMethod m)
Given a set of definite receiver types, returns a list of possible targets.


resolveAbstractDispatch

public java.util.List resolveAbstractDispatch(SootClass c,
                                              SootMethod m)
Given an abstract dispatch to an object of type c and a method m, gives a list of possible receiver methods.


resolveAbstractDispatch

public java.util.List resolveAbstractDispatch(java.util.List classes,
                                              SootMethod m)
Returns a list of possible targets for the given method and set of receiver types.


resolveSpecialDispatch

public SootMethod resolveSpecialDispatch(SpecialInvokeExpr ie,
                                         SootMethod container)
Returns the target for the given SpecialInvokeExpr.