|
|||||||||
| 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()
Returns the factory. |
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)
Method getLeastCommonSuperclass. |
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 |
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,
TypeReference rootDescriptor)
|
static ClassHierarchy |
make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
TypeReference rootDescriptor,
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)
klass -
java.lang.IllegalArgumentException - if klass is nullpublic java.util.Collection<IMethod> getPossibleTargets(MethodReference ref)
ref - method reference
java.lang.IllegalArgumentException - if ref is nullpublic IMethod resolveMethod(MethodReference m)
m -
java.lang.IllegalArgumentException - if m is nullpublic IField resolveField(FieldReference f)
java.lang.IllegalArgumentException - if f is null
public IField resolveField(IClass klass,
FieldReference f)
java.lang.IllegalArgumentException - if f is null
java.lang.IllegalArgumentException - if klass is null
public IMethod resolveMethod(IClass receiverClass,
Selector selector)
receiverClass - type of receiverselector - method signature
java.lang.IllegalArgumentException - if receiverClass is nullpublic java.lang.String toString()
toString in class java.lang.Objectpublic ClassLoaderFactory getFactory()
public IClass getLeastCommonSuperclass(IClass A,
IClass B)
A - B -
java.lang.IllegalArgumentException - if A is null
public TypeReference getLeastCommonSuperclass(TypeReference A,
TypeReference B)
public IClass lookupClass(TypeReference A)
java.lang.IllegalArgumentException - if A is nullpublic boolean isSyntheticClass(IClass c)
public boolean isSubclassOf(IClass c,
IClass T)
java.lang.IllegalArgumentException - if c is null
public boolean implementsInterface(IClass c,
TypeReference T)
c - T -
public java.util.Collection<IClass> computeSubClasses(TypeReference type)
public java.util.Collection<TypeReference> getJavaLangErrorTypes()
public boolean isInterface(TypeReference type)
public java.util.Set<IClass> getImplementors(TypeReference type)
type - an interface
public java.util.Iterator<IClass> iterator()
iterator in interface java.lang.Iterable<IClass>public int getNumberOfClasses()
public IClassLoader[] getLoaders()
public IClassLoader getLoader(ClassLoaderReference loaderRef)
public AnalysisScope getScope()
public int getNumberOfImmediateSubclasses(IClass klass)
klass -
public java.util.Collection<IClass> getImmediateSubclasses(IClass klass)
klass -
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,
TypeReference rootDescriptor)
throws ClassHierarchyException
ClassHierarchyException
public static ClassHierarchy make(AnalysisScope scope,
ClassLoaderFactory factory,
WarningSet warnings,
TypeReference rootDescriptor,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws ClassHierarchyException
ClassHierarchyExceptionpublic IClass getRootClass()
public int getNumber(IClass c)
public boolean isAssignableFrom(IClass c1,
IClass c2)
java.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 | ||||||||