public class TypeSystem
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areErasuresEqual(AType a,
AType b) |
static ClassType |
box(TypeResolver resolver,
PrimitiveType type) |
static AType |
capture(AType type) |
static ClassType |
capture(ClassType type) |
static ParameterizedClass |
capture(ParameterizedClass type) |
static ReferenceType |
capture(ReferenceType type) |
static ClassType |
erase(ClassType type) |
static ReferenceType |
erase(ReferenceType type) |
static ReferenceType |
erase(ReferenceType type,
boolean toConcreteType) |
static ClassType |
findParameterization(ClassType decl,
ReferenceType inType) |
static @Nullable ClassType |
findParameterizationOrNull(ClassType decl,
ReferenceType inType) |
static java.util.LinkedList<ReferenceType> |
getCommonDeclaredHierarchy(ReferenceType... types) |
static ReferenceType |
glb(java.lang.Iterable<ReferenceType> types) |
static ReferenceType |
glb(ReferenceType a,
ReferenceType b) |
static ReferenceType |
glbJavac(java.lang.Iterable<ReferenceType> types)
Ignores any types with an erasure that is a supertype of an earlier type
That is, if there are multiple generic parameterizations for a class [on a hierarchy], the latter will be ignored
|
static ReferenceType |
glbJavac(ReferenceType a,
ReferenceType b)
Ignores b if it already has a different parameterization in a
|
static IntersectionType |
intersection(ReferenceType upperBound,
ClassType interfaceType) |
static boolean |
isAssignableTo(AType from,
AType to) |
static boolean |
isAssignableTo(AType from,
AType to,
boolean allowUnchecked) |
static boolean |
isAssignableTo(ReferenceType from,
ReferenceType to) |
static boolean |
isAssignableTo(ReferenceType from,
ReferenceType to,
boolean allowUnchecked) |
static boolean |
isCastableTo(ReferenceType from,
ReferenceType to,
boolean allowWidening) |
static boolean |
isConstructedViaTargetInstance(ClassType clazz) |
static boolean |
isFullyDefined(ClassType type) |
static boolean |
isFullyDefined(Method method) |
static boolean |
isFullyDefined(ReferenceType type) |
static boolean |
isGeneric(ClassType clazz) |
static boolean |
isIntegerConstant(AType type) |
static boolean |
isInterface(ReferenceType t) |
static boolean |
isObject(AType type) |
static boolean |
isString(AType type) |
static boolean |
isSubType(ReferenceType type,
ReferenceType decl) |
static ReferenceType |
lub(ReferenceType... types) |
static ReferenceType |
lub(net.covers1624.coffeegrinder.type.TypeSystem.RecursiveLCTACache cache,
ReferenceType... types) |
static ReferenceType |
makeMultiCatchUnion(ReferenceType a,
ReferenceType b) |
static ClassType |
makeThisType(ClassType clazz) |
static boolean |
mapTypes(java.util.Map<TypeParameter,ReferenceType> mappings,
ReferenceType t1,
ReferenceType t2) |
static boolean |
needsOuterParameterization(ClassType clazz) |
static ClassType |
objectType(ReferenceType type) |
static TypeResolver |
resolver(ReferenceType type) |
static @Nullable PrimitiveType |
unbox(ReferenceType type) |
public static boolean isSubType(ReferenceType type, ReferenceType decl)
type - The type to search the hierarchy ofdecl - The parent typedecl exists on the hierarchy of (or equals) typepublic static boolean isAssignableTo(ReferenceType from, ReferenceType to)
public static boolean isAssignableTo(ReferenceType from, ReferenceType to, boolean allowUnchecked)
public static boolean isCastableTo(ReferenceType from, ReferenceType to, boolean allowWidening)
public static ReferenceType erase(ReferenceType type)
public static ReferenceType erase(ReferenceType type, boolean toConcreteType)
public static ReferenceType makeMultiCatchUnion(ReferenceType a, ReferenceType b)
public static IntersectionType intersection(ReferenceType upperBound, ClassType interfaceType)
public static ReferenceType glb(ReferenceType a, ReferenceType b)
public static ReferenceType glb(java.lang.Iterable<ReferenceType> types)
public static ReferenceType glbJavac(ReferenceType a, ReferenceType b)
Unlike glb(ReferenceType, ReferenceType) accepts IntersectionType for b
Not quite technically equivalent to javac, because we don't do a full supertype tree flatten, but results are weird in the cases it matters
public static ReferenceType glbJavac(java.lang.Iterable<ReferenceType> types)
Not quite technically equivalent to javac, because we don't do a full supertype tree flatten, but results are weird in the cases it matters
public static ReferenceType lub(ReferenceType... types)
public static ReferenceType lub(net.covers1624.coffeegrinder.type.TypeSystem.RecursiveLCTACache cache, ReferenceType... types)
public static java.util.LinkedList<ReferenceType> getCommonDeclaredHierarchy(ReferenceType... types)
public static boolean mapTypes(java.util.Map<TypeParameter,ReferenceType> mappings, ReferenceType t1, ReferenceType t2)
public static ClassType box(TypeResolver resolver, PrimitiveType type)
@Nullable public static @Nullable PrimitiveType unbox(ReferenceType type)
public static boolean isFullyDefined(ReferenceType type)
public static boolean isFullyDefined(ClassType type)
public static boolean isFullyDefined(Method method)
public static boolean isConstructedViaTargetInstance(ClassType clazz)
public static boolean needsOuterParameterization(ClassType clazz)
public static boolean isGeneric(ClassType clazz)
public static boolean isInterface(ReferenceType t)
public static boolean isIntegerConstant(AType type)
public static ClassType findParameterization(ClassType decl, ReferenceType inType)
@Nullable public static @Nullable ClassType findParameterizationOrNull(ClassType decl, ReferenceType inType)
public static boolean isObject(AType type)
public static boolean isString(AType type)
public static ClassType objectType(ReferenceType type)
public static TypeResolver resolver(ReferenceType type)
public static ReferenceType capture(ReferenceType type)
public static ParameterizedClass capture(ParameterizedClass type)