Class TypeSystem
java.lang.Object
net.covers1624.coffeegrinder.type.TypeSystem
Created by covers1624 on 15/8/21.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareErasuresEqual(AType a, AType b) static ClassTypebox(TypeResolver resolver, PrimitiveType type) static ATypestatic ClassTypestatic ParameterizedClasscapture(ParameterizedClass type) static ReferenceTypecapture(ReferenceType type) static ClassTypestatic ReferenceTypeerase(ReferenceType type) static ReferenceTypeerase(ReferenceType type, boolean toConcreteType) static ClassTypefindParameterization(ClassType decl, ReferenceType inType) static @Nullable ClassTypefindParameterizationOrNull(ClassType decl, ReferenceType inType) static LinkedList<ReferenceType> getCommonDeclaredHierarchy(ReferenceType... types) static ReferenceTypeglb(Iterable<ReferenceType> types) static ReferenceTypeglb(ReferenceType a, ReferenceType b) static ReferenceTypeglbJavac(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 ignoredstatic ReferenceTypeIgnores b if it already has a different parameterization in astatic IntersectionTypeintersection(ReferenceType upperBound, ClassType interfaceType) static booleanisAssignableTo(AType from, AType to) static booleanisAssignableTo(AType from, AType to, boolean allowUnchecked) static booleanisAssignableTo(ReferenceType from, ReferenceType to) static booleanisAssignableTo(ReferenceType from, ReferenceType to, boolean allowUnchecked) static booleanisCastableTo(ReferenceType from, ReferenceType to, boolean allowWidening) static booleanstatic booleanisFullyDefined(ClassType type) static booleanisFullyDefined(Method method) static booleanisFullyDefined(ReferenceType type) static booleanstatic booleanisIntegerConstant(AType type) static booleanstatic booleanstatic booleanstatic booleanisSubType(ReferenceType type, ReferenceType decl) static ReferenceTypelub(ReferenceType... types) static ReferenceTypelub(net.covers1624.coffeegrinder.type.TypeSystem.RecursiveLCTACache cache, ReferenceType... types) static ReferenceTypestatic ClassTypemakeThisType(ClassType clazz) static booleanmapTypes(Map<TypeParameter, ReferenceType> mappings, ReferenceType t1, ReferenceType t2) static booleanstatic ClassTypeobjectType(ReferenceType type) static TypeResolverresolver(ReferenceType type) static @Nullable PrimitiveTypeunbox(ReferenceType type)
-
Method Details
-
isSubType
- Parameters:
type- The type to search the hierarchy ofdecl- The parent type- Returns:
- true if
declexists on the hierarchy of (or equals)type
-
isAssignableTo
-
isAssignableTo
-
isAssignableTo
-
isAssignableTo
-
isCastableTo
-
erase
-
erase
-
erase
-
makeThisType
-
makeMultiCatchUnion
-
intersection
-
glb
-
glb
-
glbJavac
Ignores b if it already has a different parameterization in aUnlike
glb(ReferenceType, ReferenceType)accepts IntersectionType for bNot quite technically equivalent to javac, because we don't do a full supertype tree flatten, but results are weird in the cases it matters
-
glbJavac
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 ignoredNot quite technically equivalent to javac, because we don't do a full supertype tree flatten, but results are weird in the cases it matters
-
lub
-
lub
public static ReferenceType lub(net.covers1624.coffeegrinder.type.TypeSystem.RecursiveLCTACache cache, ReferenceType... types) -
getCommonDeclaredHierarchy
-
mapTypes
public static boolean mapTypes(Map<TypeParameter, ReferenceType> mappings, ReferenceType t1, ReferenceType t2) -
box
-
unbox
-
isFullyDefined
-
isFullyDefined
-
isFullyDefined
-
isConstructedViaTargetInstance
-
needsOuterParameterization
-
isGeneric
-
areErasuresEqual
-
isInterface
-
isIntegerConstant
-
findParameterization
-
findParameterizationOrNull
@Nullable public static @Nullable ClassType findParameterizationOrNull(ClassType decl, ReferenceType inType) -
isObject
-
isString
-
objectType
-
resolver
-
capture
-
capture
-
capture
-
capture
-