edu.cmu.cs.crystal.util
Interface TypeHierarchy
- All Known Implementing Classes:
- CachedTypeHierarchy
public interface TypeHierarchy
isSubtypeCompatible
boolean isSubtypeCompatible(String subType,
String superType)
- Parameters:
subType
- A fully qualified type name in the classpath. Should be . separated.superType
- A fully qualified type name in the classpath. Should be . separated.
- Returns:
- true if subType <: superType
existsCommonSubtype
boolean existsCommonSubtype(String t1,
String t2)
- 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
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. It's a minor optimization, but may come in handy.
- 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