public class ClassHierarchy extends Object implements IClassHierarchy
| Modifier and Type | Method and Description |
|---|---|
boolean |
addClass(IClass klass) |
Collection<IClass> |
computeSubClasses(TypeReference type)
Return set of all subclasses of type in the Class Hierarchy TODO: Tune this implementation.
|
ClassLoaderFactory |
getFactory() |
Collection<IClass> |
getImmediateSubclasses(IClass klass) |
Set<IClass> |
getImplementors(TypeReference type)
TODO: tune this if necessary
|
Collection<TypeReference> |
getJavaLangErrorTypes()
Solely for optimization; return a Collection
|
Collection<TypeReference> |
getJavaLangRuntimeExceptionTypes()
Solely for optimization; return a Collection
|
IClass |
getLeastCommonSuperclass(IClass a,
IClass b) |
TypeReference |
getLeastCommonSuperclass(TypeReference a,
TypeReference b) |
IClassLoader |
getLoader(ClassLoaderReference loaderRef) |
IClassLoader[] |
getLoaders() |
int |
getNumber(IClass c) |
int |
getNumberOfClasses() |
int |
getNumberOfImmediateSubclasses(IClass klass) |
Set<IMethod> |
getPossibleTargets(IClass declaredClass,
MethodReference ref)
Find the possible receivers of a call to a method reference
|
Set<IMethod> |
getPossibleTargets(MethodReference ref)
Find the possible targets of a call to a method reference.
|
IClass |
getRootClass() |
AnalysisScope |
getScope() |
Set<TypeReference> |
getUnresolvedClasses()
BEGIN Custom change: remember unresolved classes
|
boolean |
implementsInterface(IClass c,
IClass i)
Does c implement i?
|
boolean |
isAssignableFrom(IClass c1,
IClass c2)
Does an expression c1 x := c2 y typecheck?
i.e.
|
boolean |
isInterface(TypeReference type) |
boolean |
isRootClass(IClass c) |
boolean |
isSubclassOf(IClass c,
IClass t)
Is c a subclass of T?
|
Iterator<IClass> |
iterator() |
IClass |
lookupClass(TypeReference a)
Find a class in this class hierarchy.
|
static ClassHierarchy |
make(AnalysisScope scope) |
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory) |
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
Language language) |
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
Language language,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor.
|
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor.
|
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
Set<Language> languages) |
static ClassHierarchy |
make(AnalysisScope scope,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor.
|
IField |
resolveField(FieldReference f) |
IField |
resolveField(IClass klass,
FieldReference f) |
IMethod |
resolveMethod(IClass receiverClass,
Selector selector)
Return the unique target of an invocation of method on an object of type declaringClass
|
IMethod |
resolveMethod(MethodReference m)
Return the unique receiver of an invocation of method on an object of type m.getDeclaredClass
|
String |
toString() |
public boolean addClass(IClass klass)
addClass in interface IClassHierarchyIllegalArgumentException - if klass is nullpublic Set<IMethod> getPossibleTargets(MethodReference ref)
getPossibleTargets in interface IClassHierarchyref - method referenceIllegalArgumentException - if ref is nullpublic Set<IMethod> getPossibleTargets(IClass declaredClass, MethodReference ref)
getPossibleTargets in interface IClassHierarchyref - method referencedeclaredClass - the class of the receiverpublic IMethod resolveMethod(MethodReference m)
resolveMethod in interface IClassHierarchym - IllegalArgumentException - if m is nullpublic IField resolveField(FieldReference f)
resolveField in interface IClassHierarchyIllegalArgumentException - if f is nullpublic IField resolveField(IClass klass, FieldReference f)
resolveField in interface IClassHierarchyIllegalArgumentException - if f is nullIllegalArgumentException - if klass is nullpublic IMethod resolveMethod(IClass receiverClass, Selector selector)
resolveMethod in interface IClassHierarchyreceiverClass - type of receiverselector - method signatureIllegalArgumentException - if receiverClass is nullpublic ClassLoaderFactory getFactory()
getFactory in interface IClassHierarchypublic IClass getLeastCommonSuperclass(IClass a, IClass b)
getLeastCommonSuperclass in interface IClassHierarchyIllegalArgumentException - if A is nullpublic TypeReference getLeastCommonSuperclass(TypeReference a, TypeReference b)
getLeastCommonSuperclass in interface IClassHierarchypublic IClass lookupClass(TypeReference a)
lookupClass in interface IClassHierarchyIClass for a if found; null if can't find the class.IllegalArgumentException - if A is nullpublic boolean isSubclassOf(IClass c, IClass t)
isSubclassOf in interface IClassHierarchyIllegalArgumentException - if c is nullpublic boolean implementsInterface(IClass c, IClass i)
implementsInterface in interface IClassHierarchypublic Collection<IClass> computeSubClasses(TypeReference type)
computeSubClasses in interface IClassHierarchypublic Collection<TypeReference> getJavaLangErrorTypes()
getJavaLangErrorTypes in interface IClassHierarchypublic Collection<TypeReference> getJavaLangRuntimeExceptionTypes()
getJavaLangRuntimeExceptionTypes in interface IClassHierarchypublic boolean isInterface(TypeReference type)
isInterface in interface IClassHierarchypublic Set<IClass> getImplementors(TypeReference type)
getImplementors in interface IClassHierarchytype - an interfacepublic int getNumberOfClasses()
getNumberOfClasses in interface IClassHierarchypublic IClassLoader[] getLoaders()
getLoaders in interface IClassHierarchypublic IClassLoader getLoader(ClassLoaderReference loaderRef)
getLoader in interface IClassHierarchypublic AnalysisScope getScope()
getScope in interface IClassHierarchypublic int getNumberOfImmediateSubclasses(IClass klass)
getNumberOfImmediateSubclasses in interface IClassHierarchypublic Collection<IClass> getImmediateSubclasses(IClass klass)
getImmediateSubclasses in interface IClassHierarchyklass - public static ClassHierarchy make(AnalysisScope scope) throws ClassHierarchyException
ClassHierarchyExceptionpublic static ClassHierarchy make(AnalysisScope scope, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws ClassHierarchyException
ClassHierarchyExceptionpublic static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory) throws ClassHierarchyException
ClassHierarchyExceptionpublic static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws ClassHierarchyException
ClassHierarchyExceptionpublic static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory, Set<Language> languages) throws ClassHierarchyException
ClassHierarchyExceptionpublic static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory, Language language) throws ClassHierarchyException
ClassHierarchyExceptionpublic static ClassHierarchy make(AnalysisScope scope, ClassLoaderFactory factory, Language language, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws ClassHierarchyException
ClassHierarchyExceptionpublic IClass getRootClass()
getRootClass in interface IClassHierarchypublic boolean isRootClass(IClass c) throws IllegalArgumentException
isRootClass in interface IClassHierarchyIllegalArgumentExceptionpublic int getNumber(IClass c)
getNumber in interface IClassHierarchypublic boolean isAssignableFrom(IClass c1, IClass c2)
isAssignableFrom in interface IClassHierarchyIllegalArgumentException - if c1 is nullIllegalArgumentException - if c2 is nullpublic final Set<TypeReference> getUnresolvedClasses()
IClassHierarchygetUnresolvedClasses in interface IClassHierarchyCopyright © 2015. All rights reserved.