Class InferenceType
java.lang.Object
org.checkerframework.framework.util.typeinference8.types.AbstractType
org.checkerframework.framework.util.typeinference8.types.InferenceType
A type-like structure that contains at least one inference variable, but is not an inference
variable.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.checkerframework.framework.util.typeinference8.types.AbstractType
AbstractType.Kind
-
Field Summary
Fields inherited from class org.checkerframework.framework.util.typeinference8.types.AbstractType
context, typeFactory
-
Method Summary
Modifier and TypeMethodDescriptionReturn a new type that is the same as this one except the variables ininstantiations
have been replaced by their instantiation.static List<AbstractType>
create
(List<AnnotatedTypeMirror> types, List<? extends TypeMirror> typeMirrors, Theta map, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context) Creates abstract types for each TypeMirror.create
(AnnotatedTypeMirror type, TypeMirror typeMirror) Creates a type using the given types.static AbstractType
create
(AnnotatedTypeMirror type, TypeMirror typeMirror, @Nullable Theta map, Java8InferenceContext context) Creates an abstract type for the given TypeMirror.static AbstractType
create
(AnnotatedTypeMirror type, TypeMirror typeMirror, @Nullable Theta map, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context) Creates an abstract type for the given TypeMirror.static AbstractType
createIgnoreInstantiated
(AnnotatedTypeMirror type, TypeMirror typeMirror, @Nullable Theta map, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context) Same ascreate(AnnotatedTypeMirror, TypeMirror, Theta, AnnotationMirrorMap, Java8InferenceContext)
, but iftype
contains any type variables that are inmap
, but already have an instantiation, they are treated as proper types.boolean
Return the underlying Java type without inference variables.Returns all inference variables mentioned in this type.Return the underlying Java type without inference variables.getKind()
Returns the kind ofAbstractType
.Returns the primary qualifiers on this type.int
hashCode()
boolean
isObject()
Return true if this type is java.lang.Object.isSubType
(ProperType superType) Isthis
a subtype ofsuperType
?toString()
Methods inherited from class org.checkerframework.framework.util.typeinference8.types.AbstractType
asSuper, capture, getComponentType, getErased, getFunctionTypeParameterTypes, getFunctionTypeReturnType, getIntersectionBounds, getMostSpecificArrayType, getTypeArguments, getTypeKind, getTypeParameterBounds, getTypeVarLowerBound, getTypeVarUpperBound, getWildcardLowerBound, getWildcardUpperBound, isInferenceType, isLowerBoundedWildcard, isLowerBoundTypeVariable, isParameterizedType, isPrimitiveArray, isProper, isRaw, isUnboundWildcard, isUpperBoundedWildcard, isUseOfVariable, isWildcardParameterizedType, replaceTypeArgs
-
Method Details
-
getKind
Description copied from class:AbstractType
Returns the kind ofAbstractType
.- Specified by:
getKind
in classAbstractType
- Returns:
- the kind of
AbstractType
-
create
public static AbstractType create(AnnotatedTypeMirror type, TypeMirror typeMirror, @Nullable Theta map, Java8InferenceContext context) Creates an abstract type for the given TypeMirror. The created type is anInferenceType
iftype
contains any type variables that are mapped to inference variables as specified bymap
. Or iftype
is a type variable that is mapped to an inference variable, thatVariable
is returned. Or iftype
contains no type variables that are mapped in an inference variable, aProperType
is returned.- Parameters:
type
- the annotated type mirrortypeMirror
- the java typemap
- a mapping from type variable to inference variablecontext
- the context- Returns:
- the abstract type for the given TypeMirror and AnnotatedTypeMirror
-
create
public static AbstractType create(AnnotatedTypeMirror type, TypeMirror typeMirror, @Nullable Theta map, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context) Creates an abstract type for the given TypeMirror. The created type is anInferenceType
iftype
contains any type variables that are mapped to inference variables as specified bymap
. Or iftype
is a type variable that is mapped to an inference variable, thatVariable
is returned. Or iftype
contains no type variables that are mapped in an inference variable, aProperType
is returned.- Parameters:
type
- the annotated type mirrortypeMirror
- the java typemap
- a mapping from type variable to inference variablequalifierVars
- a mapping from polymorphic annotation toQualifierVar
context
- the context- Returns:
- the abstract type for the given TypeMirror and AnnotatedTypeMirror
-
createIgnoreInstantiated
public static AbstractType createIgnoreInstantiated(AnnotatedTypeMirror type, TypeMirror typeMirror, @Nullable Theta map, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context) Same ascreate(AnnotatedTypeMirror, TypeMirror, Theta, AnnotationMirrorMap, Java8InferenceContext)
, but iftype
contains any type variables that are inmap
, but already have an instantiation, they are treated as proper types.- Parameters:
type
- the annotated type mirrortypeMirror
- the java typemap
- a mapping from type variable to inference variablequalifierVars
- a mapping from polymorphic annotation toQualifierVar
context
- the context- Returns:
- the abstract type for the given TypeMirror and AnnotatedTypeMirror
-
create
public static List<AbstractType> create(List<AnnotatedTypeMirror> types, List<? extends TypeMirror> typeMirrors, Theta map, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context) Creates abstract types for each TypeMirror. The created type is anInferenceType
if it contains any type variables that are mapped to inference variables as specified bymap
. Or if the type is a type variable that is mapped to an inference variable, it will return thatVariable
. Or if the type contains no type variables that are mapped in an inference variable, aProperType
is returned.- Parameters:
types
- the annotated type mirrorstypeMirrors
- the java typesmap
- a mapping from type variable to inference variablequalifierVars
- a mapping from polymorphic annotation toQualifierVar
context
- the context- Returns:
- the abstract type for the given TypeMirror and AnnotatedTypeMirror
-
create
Description copied from class:AbstractType
Creates a type using the given types.- Specified by:
create
in classAbstractType
- Parameters:
type
- annotated type mirrortypeMirror
- type mirror- Returns:
- the new type
-
equals
- Overrides:
equals
in classAbstractType
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractType
-
getJavaType
Description copied from class:AbstractType
Return the underlying Java type without inference variables.- Specified by:
getJavaType
in classAbstractType
- Returns:
- the underlying Java type without inference variables
-
getAnnotatedType
Description copied from class:AbstractType
Return the underlying Java type without inference variables.- Specified by:
getAnnotatedType
in classAbstractType
- Returns:
- the underlying Java type without inference variables
-
isObject
public boolean isObject()Description copied from class:AbstractType
Return true if this type is java.lang.Object.- Specified by:
isObject
in classAbstractType
- Returns:
- true if this type is java.lang.Object
-
getInferenceVariables
Returns all inference variables mentioned in this type.- Specified by:
getInferenceVariables
in classAbstractType
- Returns:
- all inference variables mentioned in this type
-
applyInstantiations
Description copied from class:AbstractType
Return a new type that is the same as this one except the variables ininstantiations
have been replaced by their instantiation.- Specified by:
applyInstantiations
in classAbstractType
- Returns:
- a new type that is the same as this one except the variables in
instantiations
have been replaced by their instantiation
-
toString
-
getQualifiers
Description copied from class:AbstractType
Returns the primary qualifiers on this type.- Specified by:
getQualifiers
in classAbstractType
- Returns:
- the primary qualifiers on this type
-
isSubType
Isthis
a subtype ofsuperType
?- Parameters:
superType
- the potential supertype; is a declared type with no parameters- Returns:
- if
this
is a subtype ofsuperType
, then returnConstraintSet.TRUE
; otherwise, a false bound is returned
-