|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.ipa.cha.ClassHierarchy
public class ClassHierarchy
Simple implementation of a class hierarchy
| Constructor Summary | |
|---|---|
protected |
ClassHierarchy(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
org.eclipse.core.runtime.IProgressMonitor monitor)
|
| Method Summary | |
|---|---|
boolean |
addClass(IClass klass)
|
java.util.Collection<IClass> |
computeSubClasses(TypeReference type)
Return set of all subclasses of type in the Class Hierarchy TODO: Tune this implementation. |
ClassLoaderFactory |
getFactory()
|
java.util.Collection<IClass> |
getImmediateSubclasses(IClass klass)
|
java.util.Set<IClass> |
getImplementors(TypeReference type)
TODO: tune this if necessary |
java.util.Collection<TypeReference> |
getJavaLangErrorTypes()
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)
|
java.util.Collection<IMethod> |
getPossibleTargets(MethodReference ref)
Find the possible receivers of a call to a method reference |
IClass |
getRootClass()
|
AnalysisScope |
getScope()
|
boolean |
implementsInterface(IClass c,
TypeReference T)
Does c implement T? |
boolean |
isAssignableFrom(IClass c1,
IClass c2)
Does an expression c1 x := c2 y typecheck? i.e. |
static boolean |
isInnerClass(IClass klass)
Does it look like an inner class? [TODO: is this definitive?] |
boolean |
isInterface(TypeReference type)
|
boolean |
isRootClass(IClass c)
|
boolean |
isSubclassOf(IClass c,
IClass T)
Is c a subclass of T? |
boolean |
isSyntheticClass(IClass c)
|
java.util.Iterator<IClass> |
iterator()
|
IClass |
lookupClass(TypeReference A)
Load a class using one of the loaders specified for this class hierarchy |
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings)
|
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
org.eclipse.core.runtime.IProgressMonitor monitor)
temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor. |
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
Language language)
|
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
Language language,
org.eclipse.core.runtime.IProgressMonitor monitor)
temporarily marking this internal to avoid infinite sleep with randomly chosen IProgressMonitor. |
static ClassHierarchy |
make(AnalysisScope scope,
WarningSet warnings)
|
static ClassHierarchy |
make(AnalysisScope scope,
WarningSet warnings,
org.eclipse.core.runtime.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 receiver 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 |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected ClassHierarchy(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ClassHierarchyException
ClassHierarchyException| Method Detail |
|---|
public boolean addClass(IClass klass)
addClass in interface IClassHierarchyklass -
java.lang.IllegalArgumentException - if klass is nullpublic java.util.Collection<IMethod> getPossibleTargets(MethodReference ref)
getPossibleTargets in interface IClassHierarchyref - method reference
java.lang.IllegalArgumentException - if ref is nullpublic IMethod resolveMethod(MethodReference m)
resolveMethod in interface IClassHierarchym -
java.lang.IllegalArgumentException - if m is nullpublic IField resolveField(FieldReference f)
resolveField in interface IClassHierarchyjava.lang.IllegalArgumentException - if f is null
public IField resolveField(IClass klass,
FieldReference f)
resolveField in interface IClassHierarchyjava.lang.IllegalArgumentException - if f is null
java.lang.IllegalArgumentException - if klass is null
public IMethod resolveMethod(IClass receiverClass,
Selector selector)
resolveMethod in interface IClassHierarchyreceiverClass - type of receiverselector - method signature
java.lang.IllegalArgumentException - if receiverClass is nullpublic java.lang.String toString()
toString in class java.lang.Objectpublic ClassLoaderFactory getFactory()
getFactory in interface IClassHierarchy
public IClass getLeastCommonSuperclass(IClass A,
IClass B)
getLeastCommonSuperclass in interface IClassHierarchyjava.lang.IllegalArgumentException - if A is null
public TypeReference getLeastCommonSuperclass(TypeReference A,
TypeReference B)
getLeastCommonSuperclass in interface IClassHierarchypublic IClass lookupClass(TypeReference A)
lookupClass in interface IClassHierarchyjava.lang.IllegalArgumentException - if A is nullpublic boolean isSyntheticClass(IClass c)
isSyntheticClass in interface IClassHierarchy
public boolean isSubclassOf(IClass c,
IClass T)
isSubclassOf in interface IClassHierarchyjava.lang.IllegalArgumentException - if c is null
public boolean implementsInterface(IClass c,
TypeReference T)
implementsInterface in interface IClassHierarchyc - T -
public java.util.Collection<IClass> computeSubClasses(TypeReference type)
computeSubClasses in interface IClassHierarchypublic java.util.Collection<TypeReference> getJavaLangErrorTypes()
getJavaLangErrorTypes in interface IClassHierarchypublic boolean isInterface(TypeReference type)
isInterface in interface IClassHierarchypublic java.util.Set<IClass> getImplementors(TypeReference type)
getImplementors in interface IClassHierarchytype - an interface
public java.util.Iterator<IClass> iterator()
iterator in interface java.lang.Iterable<IClass>public 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 IClassHierarchyklass -
public java.util.Collection<IClass> getImmediateSubclasses(IClass klass)
getImmediateSubclasses in interface IClassHierarchyklass -
public static ClassHierarchy make(AnalysisScope scope,
WarningSet warnings)
throws java.lang.NullPointerException,
ClassHierarchyException
scope - warnings -
ClassHierarchyException
java.lang.NullPointerException - if scope is null
public static ClassHierarchy make(AnalysisScope scope,
WarningSet warnings,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ClassHierarchyException
ClassHierarchyException
public static ClassHierarchy make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings)
throws ClassHierarchyException
ClassHierarchyException
public static ClassHierarchy make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ClassHierarchyException
ClassHierarchyException
public static ClassHierarchy make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
Language language)
throws ClassHierarchyException
ClassHierarchyException
public static ClassHierarchy make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
Language language,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ClassHierarchyException
ClassHierarchyExceptionpublic IClass getRootClass()
getRootClass in interface IClassHierarchypublic boolean isRootClass(IClass c)
isRootClass in interface IClassHierarchypublic int getNumber(IClass c)
getNumber in interface IClassHierarchy
public boolean isAssignableFrom(IClass c1,
IClass c2)
isAssignableFrom in interface IClassHierarchyjava.lang.IllegalArgumentException - if c1 is null
java.lang.IllegalArgumentException - if c2 is null
public static boolean isInnerClass(IClass klass)
throws java.lang.NullPointerException
java.lang.NullPointerException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||