Class ProperType
java.lang.Object
org.checkerframework.framework.util.typeinference8.types.AbstractType
org.checkerframework.framework.util.typeinference8.types.ProperType
A type that does not contain any inference variables.
-
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
-
Constructor Summary
ConstructorDescriptionProperType
(ExpressionTree tree, Java8InferenceContext context) Creates a proper type from the type of the expression.ProperType
(VariableTree varTree, Java8InferenceContext context) Creates a proper type from the type of the variable.ProperType
(AnnotatedTypeMirror type, TypeMirror properType, Java8InferenceContext context) Creates a proper type.ProperType
(AnnotatedTypeMirror type, TypeMirror properType, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context) Creates a proper type. -
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.boxType()
If this is a primitive type, then the proper type corresponding to its wrapper is returned.create
(AnnotatedTypeMirror atm, TypeMirror type) Creates a type using the given types.boolean
Return the underlying Java type without inference variables.Return a collection of all inference variables referenced by this type.Return the underlying Java type without inference variables.getKind()
Returns the kind ofAbstractType
.Returns the primary qualifiers on this type.int
hashCode()
isAssignable
(ProperType superType) Isthis
assignable tosuperType
?boolean
isObject()
Return true if this type is java.lang.Object.isSubType
(ProperType superType) Isthis
a subtype ofsuperType
?isSubTypeUnchecked
(ProperType superType) Isthis
an unchecked 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
-
Constructor Details
-
ProperType
Creates a proper type.- Parameters:
type
- the annotated typeproperType
- the java typecontext
- the context
-
ProperType
public ProperType(AnnotatedTypeMirror type, TypeMirror properType, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context) Creates a proper type.- Parameters:
type
- the annotated typeproperType
- the java typequalifierVars
- a mapping from polymorphic annotation toQualifierVar
context
- the context
-
ProperType
Creates a proper type from the type of the expression.- Parameters:
tree
- an expression treecontext
- the context
-
ProperType
Creates a proper type from the type of the variable.- Parameters:
varTree
- a variable treecontext
- the context
-
-
Method Details
-
getKind
Description copied from class:AbstractType
Returns the kind ofAbstractType
.- Specified by:
getKind
in classAbstractType
- Returns:
- the kind of
AbstractType
-
create
Description copied from class:AbstractType
Creates a type using the given types.- Specified by:
create
in classAbstractType
- Parameters:
atm
- annotated type mirrortype
- type mirror- Returns:
- the new type
-
boxType
If this is a primitive type, then the proper type corresponding to its wrapper is returned. Otherwise, this object is return.- Returns:
- the proper type that is the wrapper type for this type or this if no such wrapper exists
-
isSubType
Isthis
a subtype ofsuperType
?- Parameters:
superType
- super type- Returns:
- if
this
is a subtype ofsuperType
, then returnConstraintSet.TRUE
; otherwise, a false bound is returned
-
isSubTypeUnchecked
Isthis
an unchecked subtype ofsuperType
?- Parameters:
superType
- super type- Returns:
- if
this
is an unchecked subtype ofsuperType
, then returnConstraintSet.TRUE
; otherwise, a false bound is returned
-
isAssignable
Isthis
assignable tosuperType
?- Parameters:
superType
- super type- Returns:
- if
this
assignable tosuperType
, then returnConstraintSet.TRUE
; otherwise, a false bound is returned
-
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
Description copied from class:AbstractType
Return a collection of all inference variables referenced by this type.- Specified by:
getInferenceVariables
in classAbstractType
- Returns:
- a collection of all inference variables referenced by 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
-
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
-
toString
-