public class Hierarchy
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<SootClass,java.util.List<SootClass>> |
classToDirSubclasses |
protected java.util.Map<SootClass,java.util.List<SootClass>> |
classToSubclasses |
protected java.util.Map<SootClass,java.util.List<SootClass>> |
interfaceToDirImplementers |
protected java.util.Map<SootClass,java.util.List<SootClass>> |
interfaceToDirSubinterfaces |
protected java.util.Map<SootClass,java.util.List<SootClass>> |
interfaceToDirSuperinterfaces |
protected java.util.Map<SootClass,java.util.List<SootClass>> |
interfaceToSubinterfaces |
protected java.util.Map<SootClass,java.util.List<SootClass>> |
interfaceToSuperinterfaces |
Constructor and Description |
---|
Hierarchy()
Constructs a hierarchy from the current scene.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkState() |
java.util.List<SootClass> |
getDirectImplementersOf(SootClass i)
Returns a list of direct implementers of c, excluding itself.
|
java.util.List<SootClass> |
getDirectSubclassesOf(SootClass c)
Returns a list of direct subclasses of c, excluding c.
|
java.util.List<SootClass> |
getDirectSubclassesOfIncluding(SootClass c)
Returns a list of direct subclasses of c, including c.
|
java.util.List<SootClass> |
getDirectSubinterfacesOf(SootClass c)
Returns a list of direct subinterfaces of c.
|
java.util.List<SootClass> |
getDirectSubinterfacesOfIncluding(SootClass c)
Returns a list of direct subinterfaces of c, including itself.
|
java.util.List<SootClass> |
getDirectSuperclassesOf(SootClass c)
Returns a list of direct superclasses of c, excluding c.
|
java.util.List<SootClass> |
getDirectSuperinterfacesOf(SootClass c)
Returns a list of direct superinterfaces of c.
|
java.util.List<SootClass> |
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<SootClass> |
getSubclassesOf(SootClass c)
Returns a list of subclasses of c, excluding itself.
|
java.util.List<SootClass> |
getSubclassesOfIncluding(SootClass c)
Returns a list of subclasses of c, including itself.
|
java.util.List<SootClass> |
getSubinterfacesOf(SootClass sootClass)
Returns a list of subinterfaces of sootClass, excluding itself.
|
java.util.List<SootClass> |
getSubinterfacesOfIncluding(SootClass sootClass)
Returns a list of subinterfaces of sootClass, including itself.
|
java.util.List<SootClass> |
getSuperclassesOf(SootClass sootClass)
Returns a list of direct superclasses of passed class in reverse order,
starting with its parent.
|
java.util.List<SootClass> |
getSuperclassesOfIncluding(SootClass sootClass)
Returns a list of superclasses of
sootClass , including itself. |
java.util.List<SootClass> |
getSuperinterfacesOf(SootClass c)
Returns a list of superinterfaces of c, excluding itself.
|
java.util.List<SootClass> |
getSuperinterfacesOfIncluding(SootClass c)
Returns a list of superinterfaces of c, including itself.
|
protected void |
initializeHierarchy(Chain<SootClass> allClasses)
Initializes the hierarchy given a chain of all classes that shall be
included in the hierarchy
|
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 |
isInterfaceDirectSuperinterfaceOf(SootClass parent,
SootClass possibleChild)
Returns true if parent is a direct superinterface of possibleChild.
|
boolean |
isInterfaceSubinterfaceOf(SootClass child,
SootClass possibleParent)
Returns true if child is a subinterface of possibleParent.
|
boolean |
isInterfaceSuperinterfaceOf(SootClass parent,
SootClass possibleChild)
Returns true if parent is a superinterface of possibleChild.
|
boolean |
isVisible(SootClass from,
ClassMember m)
Returns true if the classmember m is visible from code in the class from.
|
boolean |
isVisible(SootClass from,
SootClass check)
Checks whether check is a visible class in view of the from class.
|
java.util.List<SootMethod> |
resolveAbstractDispatch(java.util.List<SootClass> classes,
SootMethod m)
Returns a list of possible targets for the given method and set of
receiver types.
|
java.util.List<SootMethod> |
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<SootMethod> |
resolveConcreteDispatch(java.util.List<Type> 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.
|
protected java.util.Map<SootClass,java.util.List<SootClass>> interfaceToSubinterfaces
protected java.util.Map<SootClass,java.util.List<SootClass>> interfaceToSuperinterfaces
protected java.util.Map<SootClass,java.util.List<SootClass>> classToDirSubclasses
protected java.util.Map<SootClass,java.util.List<SootClass>> interfaceToDirSubinterfaces
protected java.util.Map<SootClass,java.util.List<SootClass>> interfaceToDirSuperinterfaces
protected void initializeHierarchy(Chain<SootClass> allClasses)
allClasses
- The chain of all classes to be included in the hierarchyprotected void checkState()
public java.util.List<SootClass> getSubclassesOfIncluding(SootClass c)
public java.util.List<SootClass> getSubclassesOf(SootClass c)
public java.util.List<SootClass> getSuperclassesOfIncluding(SootClass sootClass)
sootClass
, including itself.sootClass
- the class of which superclasses will be taken. Must not be null
or
interfacejava.lang.IllegalArgumentException
- when passed class is an interfacejava.lang.NullPointerException
- when passed argument is null
public java.util.List<SootClass> getSuperclassesOf(SootClass sootClass)
sootClass
- the class of which superclasses will be taken. Must not be null
or
interfacejava.lang.IllegalArgumentException
- when passed class is an interfacejava.lang.NullPointerException
- when passed argument is null
public java.util.List<SootClass> getSubinterfacesOfIncluding(SootClass sootClass)
sootClass
- the interface of which subinterfaces will be taken. Must not be null
or
classjava.lang.IllegalArgumentException
- when passed class is a classjava.lang.NullPointerException
- when passed argument is null
public java.util.List<SootClass> getSubinterfacesOf(SootClass sootClass)
sootClass
- the interface of which subinterfaces will be taken. Must not be null
or
classjava.lang.IllegalArgumentException
- when passed sootClass is a classjava.lang.NullPointerException
- when passed argument is null
public java.util.List<SootClass> getSuperinterfacesOfIncluding(SootClass c)
public java.util.List<SootClass> getSuperinterfacesOf(SootClass c)
public java.util.List<SootClass> getDirectSuperclassesOf(SootClass c)
public java.util.List<SootClass> getDirectSubclassesOf(SootClass c)
public java.util.List<SootClass> getDirectSubclassesOfIncluding(SootClass c)
public java.util.List<SootClass> getDirectSuperinterfacesOf(SootClass c)
public java.util.List<SootClass> getDirectSubinterfacesOf(SootClass c)
public java.util.List<SootClass> getDirectSubinterfacesOfIncluding(SootClass c)
public java.util.List<SootClass> getDirectImplementersOf(SootClass i)
public java.util.List<SootClass> getImplementersOf(SootClass i)
public boolean isClassSubclassOf(SootClass child, SootClass possibleParent)
public boolean isClassSubclassOfIncluding(SootClass child, SootClass possibleParent)
public boolean isClassDirectSubclassOf(SootClass c, SootClass c2)
public boolean isClassSuperclassOf(SootClass parent, SootClass possibleChild)
public boolean isClassSuperclassOfIncluding(SootClass parent, SootClass possibleChild)
public boolean isInterfaceSubinterfaceOf(SootClass child, SootClass possibleParent)
public boolean isInterfaceDirectSubinterfaceOf(SootClass child, SootClass possibleParent)
public boolean isInterfaceSuperinterfaceOf(SootClass parent, SootClass possibleChild)
public boolean isInterfaceDirectSuperinterfaceOf(SootClass parent, SootClass possibleChild)
public SootClass getLeastCommonSuperclassOf(SootClass c1, SootClass c2)
public boolean isVisible(SootClass from, SootClass check)
public boolean isVisible(SootClass from, ClassMember m)
public SootMethod resolveConcreteDispatch(SootClass concreteType, SootMethod m)
public java.util.List<SootMethod> resolveConcreteDispatch(java.util.List<Type> classes, SootMethod m)
public java.util.List<SootMethod> resolveAbstractDispatch(SootClass c, SootMethod m)
public java.util.List<SootMethod> resolveAbstractDispatch(java.util.List<SootClass> classes, SootMethod m)
public SootMethod resolveSpecialDispatch(SpecialInvokeExpr ie, SootMethod container)