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, ignoreAnnotations, typeFactory -
Constructor Summary
ConstructorsConstructorDescriptionProperType(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, Java8InferenceContext context, boolean ignoreAnnotations) Creates a proper type.ProperType(AnnotatedTypeMirror type, TypeMirror properType, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context, boolean ignoreAnnotations) Creates a proper type. -
Method Summary
Modifier and TypeMethodDescriptionReturn a new type that is the same as this one except the variables ininstantiationshave 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, boolean ignoreAnnotations) Creates a type using the given types.booleanReturn 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.inthashCode()isAssignable(ProperType superType) Isthisassignable tosuperType?booleanisObject()Return true if this type is java.lang.Object.isSubType(ProperType superType) Isthisa subtype ofsuperType?isSubTypeUnchecked(ProperType superType) Isthisan 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, Java8InferenceContext context, boolean ignoreAnnotations) Creates a proper type.- Parameters:
type- the annotated typeproperType- the java typecontext- the contextignoreAnnotations- whether the annotations on this type should be ignored
-
ProperType
public ProperType(AnnotatedTypeMirror type, TypeMirror properType, AnnotationMirrorMap<QualifierVar> qualifierVars, Java8InferenceContext context, boolean ignoreAnnotations) Creates a proper type.- Parameters:
type- the annotated typeproperType- the java typequalifierVars- a mapping from polymorphic annotation toQualifierVarcontext- the contextignoreAnnotations- whether the annotations on this type should be ignored
-
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:AbstractTypeReturns the kind ofAbstractType.- Specified by:
getKindin classAbstractType- Returns:
- the kind of
AbstractType
-
create
Description copied from class:AbstractTypeCreates a type using the given types.- Specified by:
createin classAbstractType- Parameters:
atm- annotated type mirrortype- type mirrorignoreAnnotations- whether the annotations on this type should be ignored- 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
Isthisa subtype ofsuperType?- Parameters:
superType- super type- Returns:
- if
thisis a subtype ofsuperType, then returnConstraintSet.TRUE; otherwise, a false bound is returned
-
isSubTypeUnchecked
Isthisan unchecked subtype ofsuperType?- Parameters:
superType- super type- Returns:
- if
thisis an unchecked subtype ofsuperType, then returnConstraintSet.TRUE; otherwise, a false bound is returned
-
isAssignable
Isthisassignable tosuperType?- Parameters:
superType- super type- Returns:
- if
thisassignable tosuperType, then returnConstraintSet.TRUE; otherwise, a false bound is returned
-
equals
- Overrides:
equalsin classAbstractType
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractType
-
getJavaType
Description copied from class:AbstractTypeReturn the underlying Java type without inference variables.- Specified by:
getJavaTypein classAbstractType- Returns:
- the underlying Java type without inference variables
-
getAnnotatedType
Description copied from class:AbstractTypeReturn the underlying Java type without inference variables.- Specified by:
getAnnotatedTypein classAbstractType- Returns:
- the underlying Java type without inference variables
-
isObject
public boolean isObject()Description copied from class:AbstractTypeReturn true if this type is java.lang.Object.- Specified by:
isObjectin classAbstractType- Returns:
- true if this type is java.lang.Object
-
getInferenceVariables
Description copied from class:AbstractTypeReturn a collection of all inference variables referenced by this type.- Specified by:
getInferenceVariablesin classAbstractType- Returns:
- a collection of all inference variables referenced by this type
-
applyInstantiations
Description copied from class:AbstractTypeReturn a new type that is the same as this one except the variables ininstantiationshave been replaced by their instantiation.- Specified by:
applyInstantiationsin classAbstractType- Returns:
- a new type that is the same as this one except the variables in
instantiationshave been replaced by their instantiation
-
getQualifiers
Description copied from class:AbstractTypeReturns the primary qualifiers on this type.- Specified by:
getQualifiersin classAbstractType- Returns:
- the primary qualifiers on this type
-
toString
-