edu.cmu.cs.crystal.util.typehierarchy
Class CachedTypeHierarchy

java.lang.Object
  extended by edu.cmu.cs.crystal.util.typehierarchy.CachedTypeHierarchy
All Implemented Interfaces:
TypeHierarchy

public class CachedTypeHierarchy
extends Object
implements TypeHierarchy


Constructor Summary
CachedTypeHierarchy(IJavaProject project)
           
 
Method Summary
 boolean existsCommonSubtype(String t1, String t2)
           
 boolean existsCommonSubtype(String t1, String t2, boolean skipCheck1, boolean skipCheck2)
          A version of existsCommonSubtype that allows for the client to skip checks if the client has already done them.
 boolean isSubtypeCompatible(String subTypeFullName, String superTypeFullName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedTypeHierarchy

public CachedTypeHierarchy(IJavaProject project)
                    throws JavaModelException
Throws:
JavaModelException
Method Detail

existsCommonSubtype

public boolean existsCommonSubtype(String t1,
                                   String t2)
Specified by:
existsCommonSubtype in interface TypeHierarchy
Parameters:
t1 - A fully qualified type name in the classpath. Should be . separated.
t2 - A fully qualified type name in the classpath. Should be . separated.
Returns:
true if there exists some t3 such that t3 <: t1 and t3 <: t2

existsCommonSubtype

public boolean existsCommonSubtype(String t1,
                                   String t2,
                                   boolean skipCheck1,
                                   boolean skipCheck2)
Description copied from interface: TypeHierarchy
A version of existsCommonSubtype that allows for the client to skip checks if the client has already done them. It's a minor optimization, but may come in handy.

Specified by:
existsCommonSubtype in interface TypeHierarchy
Parameters:
t1 - A fully qualified type name in the classpath. Should be . separated.
t2 - A fully qualified type name in the classpath. Should be . separated.
skipCheck1 - true if we should skip the check for t1 <: t2.
skipCheck2 - true if we should skip the check for t2 <: t1
Returns:
true if there exists some t3 such that t3 <: t1 and t3 <: t2

isSubtypeCompatible

public boolean isSubtypeCompatible(String subTypeFullName,
                                   String superTypeFullName)
Specified by:
isSubtypeCompatible in interface TypeHierarchy
Parameters:
subTypeFullName - A fully qualified type name in the classpath. Should be . separated.
superTypeFullName - A fully qualified type name in the classpath. Should be . separated.
Returns:
true if subType <: superType