Class DefaultTypeHierarchy
- All Implemented Interfaces:
TypeHierarchy,AtmComboVisitor<Boolean,Void>
Subtyping rules of the JLS can be found in section 4.10, "Subtyping".
Note: The visit methods of this class must be public but it is intended to be used through a TypeHierarchy interface reference which will only allow isSubtype to be called. Clients should not call the visit methods.
The visit methods return true if the first argument is a subtype of the second argument.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StructuralEqualityVisitHistoryStores the result ofareEqualInHierarchy(AnnotatedTypeMirror, AnnotatedTypeMirror)for type arguments.protected final BaseTypeCheckerThe type-checker that is associated with this.protected AnnotationMirrorThe top annotation of the hierarchy currently being checked.protected final StructuralEqualityComparerThe equality comparer.protected final booleanWhether to ignore raw types.protected final booleanWhether to make array subtyping invariant with respect to array component types.protected final SubtypeVisitHistoryStores the result of isSubtype, if that result is true.protected final QualifierHierarchyThe qualifier hierarchy that is associated with this. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultTypeHierarchy(BaseTypeChecker checker, QualifierHierarchy qualHierarchy, boolean ignoreRawTypes, boolean invariantArrayComponents) Creates a DefaultTypeHierarchy. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanareAllSubtypes(Iterable<? extends AnnotatedTypeMirror> subtypes, AnnotatedTypeMirror supertype) Are all the types insubtypesa subtype ofsupertype?protected booleanareEqualInHierarchy(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2) protected StructuralEqualityComparerCreate the equality comparer.defaultErrorMessage(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, Void p) Returns error message for the case when two types shouldn't be compared.Returns a list of the indices of the type arguments that are covariant.protected booleanisContainedBy(AnnotatedTypeMirror inside, AnnotatedTypeMirror outside, boolean canBeCovariant) Returns true ifoutsidecontainsinside, that is, if the set of types denoted byoutsideis a superset of, or equal to, the set of types denoted byinside.protected booleanisContainedMany(List<? extends AnnotatedTypeMirror> subtypeTypeArgs, List<? extends AnnotatedTypeMirror> supertypeTypeArgs, List<Integer> covariantArgIndexes) CallsisContainedBy(AnnotatedTypeMirror, AnnotatedTypeMirror, boolean)on the two lists of type arguments.protected booleanisContainedWithinBounds(AnnotatedTypeMirror inside, AnnotatedTypeMirror outsideLower, AnnotatedTypeMirror outsideUpper, boolean canBeCovariant) Letoutsidebe? super outsideLower extends outsideUpper.protected booleanisPrimarySubtype(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) Compare the primary annotations ofsubtypeandsupertype.booleanisSubtype(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) Returns true if subtype <: supertype.protected booleanisSubtype(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror top) Returns true ifsubtype <: supertype, but only for the hierarchy of whichtopis the top.protected booleanisSubtypeCaching(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) LikeisSubtype(AnnotatedTypeMirror, AnnotatedTypeMirror), but uses a cache to prevent infinite recursion on recursive types.booleanisSubtypeShallowEffective(Collection<? extends AnnotationMirror> subQualifiers, AnnotatedTypeMirror supertype) Tests whethersubQualifiersare equal to or are sub-qualifiers of the effective annotations ofsupertype, according to the type qualifier hierarchy.booleanisSubtypeShallowEffective(AnnotationMirror subQualifier, AnnotatedTypeMirror supertype) Tests whethersubQualifieris equal to or sub-qualifier of the effective annotation ofsupertypein the same hierarchy assubQualifieraccording to the type qualifier hierarchy.booleanisSubtypeShallowEffective(AnnotatedTypeMirror subtype, Collection<? extends AnnotationMirror> superQualifiers) Tests whether the effective annotations ofsubtypeare equal to or are sub-qualifiers ofsuperQualifiers, according to the type qualifier hierarchy.booleanisSubtypeShallowEffective(AnnotatedTypeMirror subtype, AnnotationMirror superQualifier) Tests whether the effective annotation ofsubtypein the same hierarchy assuperQualifieris equal to or sub-qualifier ofsuperQualifier, according to the type qualifier hierarchy.booleanisSubtypeShallowEffective(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) Tests whether the effective annotations ofsubtypeare equal to or are sub-qualifiers of the effective annotations ofsupertype, according to the type qualifier hierarchy.booleanisSubtypeShallowEffective(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror hierarchy) Tests whether the effective annotation in the same hierarchy ashierarchyofsubtypeare equal to or are sub-qualifiers of the effective annotation ofsupertypein the same hierarchy ashierarchy, according to the type qualifier hierarchy.visitArray_Array(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) visitArray_Declared(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) visitArray_Intersection(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) visitArray_Null(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) visitArray_Typevar(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable superType, Void p) visitArray_Wildcard(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) visitDeclared_Array(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) visitDeclared_Declared(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) visitDeclared_Intersection(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) visitDeclared_Null(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) visitDeclared_Primitive(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) visitDeclared_Typevar(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) visitDeclared_Union(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) visitDeclared_Wildcard(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) visitIntersection_Declared(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) visitIntersection_Intersection(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) visitIntersection_Null(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) visitIntersection_Primitive(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) protected booleanvisitIntersection_Type(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror supertype) An intersection is a subtype if one of its bounds is a subtype ofsupertype.visitIntersection_Typevar(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) visitIntersection_Wildcard(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) visitNull_Array(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) visitNull_Declared(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) visitNull_Intersection(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) visitNull_Null(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) visitNull_Primitive(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) visitNull_Typevar(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) visitNull_Union(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) visitNull_Wildcard(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) visitPrimitive_Declared(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) visitPrimitive_Intersection(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) visitPrimitive_Primitive(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) visitPrimitive_Typevar(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) visitPrimitive_Wildcard(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) protected booleanvisitType_Intersection(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype) An intersection is a supertype if all of its bounds are a supertype of subtype.protected booleanvisitType_Typevar(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype) A type variable is a supertype if its lower bound is above subtype.protected booleanvisitType_Wildcard(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype) Check a wildcard type's relation against a subtype.protected booleanvisitTypeArgs(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, boolean subtypeRaw, boolean supertypeRaw) Returns true if the type arguments insupertypecontain the type arguments insubtypeand false otherwise.visitTypevar_Array(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) visitTypevar_Declared(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) visitTypevar_Intersection(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) visitTypevar_Null(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) visitTypevar_Primitive(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) protected booleanvisitTypevar_Type(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror supertype) A type variable is a subtype if its upper bound is below the supertype.visitTypevar_Typevar(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) visitTypevar_Wildcard(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) visitUnion_Declared(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) visitUnion_Intersection(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) protected booleanvisitUnion_Type(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror supertype) A union type is a subtype if ALL of its alternatives are subtypes of supertype.visitUnion_Typevar(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) visitUnion_Union(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) visitUnion_Wildcard(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) visitWildcard_Array(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) visitWildcard_Declared(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) visitWildcard_Intersection(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) visitWildcard_Primitive(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) protected booleanvisitWildcard_Type(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror supertype) Check a wildcard type's relation against a supertype.visitWildcard_Typevar(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) visitWildcard_Wildcard(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) Methods inherited from class org.checkerframework.framework.type.visitor.AbstractAtmComboVisitor
visit, visitArray_Executable, visitArray_None, visitArray_Primitive, visitArray_Union, visitDeclared_Executable, visitDeclared_None, visitExecutable_Array, visitExecutable_Declared, visitExecutable_Executable, visitExecutable_Intersection, visitExecutable_None, visitExecutable_Null, visitExecutable_Primitive, visitExecutable_Typevar, visitExecutable_Union, visitExecutable_Wildcard, visitIntersection_Array, visitIntersection_Executable, visitIntersection_None, visitIntersection_Union, visitNone_Array, visitNone_Declared, visitNone_Executable, visitNone_Intersection, visitNone_None, visitNone_Null, visitNone_Primitive, visitNone_Union, visitNone_Wildcard, visitNull_Executable, visitNull_None, visitPrimitive_Array, visitPrimitive_Executable, visitPrimitive_None, visitPrimitive_Null, visitPrimitive_Union, visitTypevar_Executable, visitTypevar_None, visitTypevar_Union, visitUnion_Array, visitUnion_Executable, visitUnion_None, visitUnion_Null, visitUnion_Primitive, visitWildcard_Executable, visitWildcard_None, visitWildcard_Null, visitWildcard_UnionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.checkerframework.framework.type.visitor.AtmComboVisitor
defaultAction
-
Field Details
-
checker
The type-checker that is associated with this.Used for processingEnvironment when needed.
-
qualHierarchy
The qualifier hierarchy that is associated with this. -
equalityComparer
The equality comparer. -
ignoreRawTypes
protected final boolean ignoreRawTypesWhether to ignore raw types. -
invariantArrayComponents
protected final boolean invariantArrayComponentsWhether to make array subtyping invariant with respect to array component types. -
currentTop
The top annotation of the hierarchy currently being checked. -
isSubtypeVisitHistory
Stores the result of isSubtype, if that result is true. -
areEqualVisitHistory
Stores the result ofareEqualInHierarchy(AnnotatedTypeMirror, AnnotatedTypeMirror)for type arguments. Prevents infinite recursion on types that refer to themselves. (Stores both true and false results.)
-
-
Constructor Details
-
DefaultTypeHierarchy
public DefaultTypeHierarchy(BaseTypeChecker checker, QualifierHierarchy qualHierarchy, boolean ignoreRawTypes, boolean invariantArrayComponents) Creates a DefaultTypeHierarchy.- Parameters:
checker- the type-checker that is associated with thisqualHierarchy- the qualifier hierarchy that is associated with thisignoreRawTypes- whether to ignore raw typesinvariantArrayComponents- whether to make array subtyping invariant with respect to array component types
-
-
Method Details
-
createEqualityComparer
Create the equality comparer.- Returns:
- the equality comparer
-
isSubtype
Returns true if subtype <: supertype.This implementation iterates over all top annotations and invokes
isSubtype(AnnotatedTypeMirror, AnnotatedTypeMirror, AnnotationMirror). Most type systems should not override this method, but instead overrideisSubtype(AnnotatedTypeMirror, AnnotatedTypeMirror, AnnotationMirror)or some of thevisitXXXmethods.- Specified by:
isSubtypein interfaceTypeHierarchy- Parameters:
subtype- expected subtypesupertype- expected supertype- Returns:
- true if subtype is a subtype of supertype or equal to it
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) Description copied from interface:TypeHierarchyTests whether the effective annotations ofsubtypeare equal to or are sub-qualifiers of the effective annotations ofsupertype, according to the type qualifier hierarchy.The underlying types of
subtypeandsupertypeare not necessarily in a Java subtyping relationship with one another and are only used by this method for special cases when qualifier subtyping depends on the Java basetype.- Specified by:
isSubtypeShallowEffectivein interfaceTypeHierarchy- Parameters:
subtype- possible subtypesupertype- possible supertype- Returns:
- true iff the effective annotations of
subtypeare equal to or are sub-qualifiers of the effective annotations ofsupertype
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror hierarchy) Description copied from interface:TypeHierarchyTests whether the effective annotation in the same hierarchy ashierarchyofsubtypeare equal to or are sub-qualifiers of the effective annotation ofsupertypein the same hierarchy ashierarchy, according to the type qualifier hierarchy. Other annotations insubtypeandsupertypeare ignored.The underlying types of
subtypeandsupertypeare not necessarily in a Java subtyping relationship with one another and are only used by this method for special cases when qualifier subtyping depends on the Java basetype.- Specified by:
isSubtypeShallowEffectivein interfaceTypeHierarchy- Parameters:
subtype- possible subtypesupertype- possible supertypehierarchy- an annotation whose hierarchy is used to comparesubtypeandsupertype- Returns:
- true iff the effective annotation in the same hierarchy as
hierarchyofsubtypeare equal to or are sub-qualifiers of the effective annotation ofsupertypein the same hierarchy ashierarchy
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(AnnotatedTypeMirror subtype, Collection<? extends AnnotationMirror> superQualifiers) Description copied from interface:TypeHierarchyTests whether the effective annotations ofsubtypeare equal to or are sub-qualifiers ofsuperQualifiers, according to the type qualifier hierarchy. Other annotations insubtypeare ignored.The underlying type of
subtypeis only used by this method for special cases when qualifier subtyping depends on the Java basetype.- Specified by:
isSubtypeShallowEffectivein interfaceTypeHierarchy- Parameters:
subtype- possible subtypesuperQualifiers- possible superQualifiers- Returns:
- true iff the effective annotations of
subtypeare equal to or are sub-qualifiers ofsuperQualifiers
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(Collection<? extends AnnotationMirror> subQualifiers, AnnotatedTypeMirror supertype) Description copied from interface:TypeHierarchyTests whethersubQualifiersare equal to or are sub-qualifiers of the effective annotations ofsupertype, according to the type qualifier hierarchy. Other annotations insupertypeare ignored.The underlying type of
supertypeis used by this method for special cases when qualifier subtyping depends on the Java basetype.- Specified by:
isSubtypeShallowEffectivein interfaceTypeHierarchy- Parameters:
subQualifiers- possible subQualifierssupertype- possible supertype- Returns:
- true iff
subQualifiersare equal to or are sub-qualifiers of the effective annotations ofsupertype
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(AnnotatedTypeMirror subtype, AnnotationMirror superQualifier) Description copied from interface:TypeHierarchyTests whether the effective annotation ofsubtypein the same hierarchy assuperQualifieris equal to or sub-qualifier ofsuperQualifier, according to the type qualifier hierarchy. The underlying types ofsubtypeis only used by this method for special cases when qualifier subtyping depends on the Java basetype. Other annotations insubtypeare ignored.- Specified by:
isSubtypeShallowEffectivein interfaceTypeHierarchy- Parameters:
subtype- possible subtypesuperQualifier- possible super qualifier- Returns:
- true iffhe effective annotation of
subtypein the same hierarchy assuperQualifieris equal to or sub-qualifier ofsuperQualifier
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(AnnotationMirror subQualifier, AnnotatedTypeMirror supertype) Description copied from interface:TypeHierarchyTests whethersubQualifieris equal to or sub-qualifier of the effective annotation ofsupertypein the same hierarchy assubQualifieraccording to the type qualifier hierarchy. The underlying types ofsupertypeis only used by this method for special cases when qualifier subtyping depends on the Java basetype. Other annotations insupertypeare ignored.- Specified by:
isSubtypeShallowEffectivein interfaceTypeHierarchy- Parameters:
subQualifier- possible subQualifiersupertype- possible supertype- Returns:
- true
subQualifieris equal to or sub-qualifier of the effective annotation ofsupertypein the same hierarchy assubQualifier
-
isSubtype
protected boolean isSubtype(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror top) Returns true ifsubtype <: supertype, but only for the hierarchy of whichtopis the top.- Parameters:
subtype- expected subtypesupertype- expected supertypetop- the top of the hierarchy for which we want to make a comparison- Returns:
- true if
subtypeis a subtype of or equal tosupertype, in the qualifier hierarchy whose top istop
-
defaultErrorMessage
public String defaultErrorMessage(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, Void p) Returns error message for the case when two types shouldn't be compared.- Specified by:
defaultErrorMessagein interfaceAtmComboVisitor<Boolean,Void> - Parameters:
subtype- the first AnnotatedTypeMirror parameter to the visit method calledsupertype- the second AnnotatedTypeMirror parameter to the visit method calledp- subtype specific parameter passed to every visit method- Returns:
- error message for the case when two types shouldn't be compared
-
isPrimarySubtype
Compare the primary annotations ofsubtypeandsupertype. Neither type can be missing annotations.- Parameters:
subtype- a type that might be a subtype (with respect to primary annotations)supertype- a type that might be a supertype (with respect to primary annotations)- Returns:
- true if the primary annotation on subtype <: primary annotation on supertype for the current top.
-
isSubtypeCaching
LikeisSubtype(AnnotatedTypeMirror, AnnotatedTypeMirror), but uses a cache to prevent infinite recursion on recursive types.- Parameters:
subtype- a type that may be a subtypesupertype- a type that may be a supertype- Returns:
- true if subtype <: supertype
-
areAllSubtypes
protected boolean areAllSubtypes(Iterable<? extends AnnotatedTypeMirror> subtypes, AnnotatedTypeMirror supertype) Are all the types insubtypesa subtype ofsupertype?The underlying type mirrors of
subtypesmust be subtypes of the underlying type mirror ofsupertype. -
areEqualInHierarchy
-
isContainedBy
protected boolean isContainedBy(AnnotatedTypeMirror inside, AnnotatedTypeMirror outside, boolean canBeCovariant) Returns true ifoutsidecontainsinside, that is, if the set of types denoted byoutsideis a superset of, or equal to, the set of types denoted byinside.Containment is described in JLS section 4.5.1 "Type Arguments of Parameterized Types".
As described in JLS section 4.10.2 Subtyping among Class and Interface Types, a declared type S is considered a supertype of another declared type T only if all of S's type arguments "contain" the corresponding type arguments of the subtype T.
- Parameters:
inside- a possibly-contained type; its underlying type is contained byoutside's underlying typeoutside- a possibly-containing type; its underlying type containsinside's underlying typecanBeCovariant- whether or not type arguments are allowed to be covariant- Returns:
- true if inside is contained by outside, or if canBeCovariant == true and
inside <: outside
-
isContainedWithinBounds
protected boolean isContainedWithinBounds(AnnotatedTypeMirror inside, AnnotatedTypeMirror outsideLower, AnnotatedTypeMirror outsideUpper, boolean canBeCovariant) Letoutsidebe? super outsideLower extends outsideUpper. Returns true ifoutsidecontainsinside, that is, if the set of types denoted byoutsideis a superset of, or equal to, the set of types denoted byinside.This method is a helper method for
isContainedBy(AnnotatedTypeMirror, AnnotatedTypeMirror, boolean).- Parameters:
inside- a possibly-contained typeoutsideLower- the lower bound of the possibly-containing typeoutsideUpper- the upper bound of the possibly-containing typecanBeCovariant- whether or not type arguments are allowed to be covariant- Returns:
- true if inside is contained by outside, or if canBeCovariant == true and
inside <: outside
-
visitArray_Array
public Boolean visitArray_Array(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitArray_Arrayin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitArray_Arrayin classAbstractAtmComboVisitor<Boolean,Void>
-
visitArray_Declared
public Boolean visitArray_Declared(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitArray_Declaredin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitArray_Declaredin classAbstractAtmComboVisitor<Boolean,Void>
-
visitArray_Null
public Boolean visitArray_Null(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitArray_Nullin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitArray_Nullin classAbstractAtmComboVisitor<Boolean,Void>
-
visitArray_Intersection
public Boolean visitArray_Intersection(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitArray_Intersectionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitArray_Intersectionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitArray_Wildcard
public Boolean visitArray_Wildcard(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitArray_Wildcardin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitArray_Wildcardin classAbstractAtmComboVisitor<Boolean,Void>
-
visitArray_Typevar
public Boolean visitArray_Typevar(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable superType, Void p) - Specified by:
visitArray_Typevarin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitArray_Typevarin classAbstractAtmComboVisitor<Boolean,Void>
-
visitDeclared_Array
public Boolean visitDeclared_Array(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitDeclared_Arrayin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitDeclared_Arrayin classAbstractAtmComboVisitor<Boolean,Void>
-
visitDeclared_Declared
public Boolean visitDeclared_Declared(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitDeclared_Declaredin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitDeclared_Declaredin classAbstractAtmComboVisitor<Boolean,Void>
-
visitTypeArgs
protected boolean visitTypeArgs(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, boolean subtypeRaw, boolean supertypeRaw) Returns true if the type arguments insupertypecontain the type arguments insubtypeand false otherwise. SeeisContainedBy(org.checkerframework.framework.type.AnnotatedTypeMirror, org.checkerframework.framework.type.AnnotatedTypeMirror, boolean)for an explanation of containment.- Parameters:
subtype- a possible subtypesupertype- a possible supertypesubtypeRaw- whethersubtypeis a raw typesupertypeRaw- whethersupertypeis a raw type- Returns:
- true if the type arguments in
supertypecontain the type arguments insubtypeand false otherwise
-
getCovariantArgIndexes
Description copied from interface:TypeHierarchyReturns a list of the indices of the type arguments that are covariant.- Specified by:
getCovariantArgIndexesin interfaceTypeHierarchy- Parameters:
type- a type- Returns:
- a list of the indices of the type arguments that are covariant
-
isContainedMany
protected boolean isContainedMany(List<? extends AnnotatedTypeMirror> subtypeTypeArgs, List<? extends AnnotatedTypeMirror> supertypeTypeArgs, List<Integer> covariantArgIndexes) CallsisContainedBy(AnnotatedTypeMirror, AnnotatedTypeMirror, boolean)on the two lists of type arguments. Returns true if every type argument insupertypeTypeArgscontains the type argument at the same index insubtypeTypeArgs.- Parameters:
subtypeTypeArgs- subtype argumentssupertypeTypeArgs- supertype argumentscovariantArgIndexes- indexes into the type arguments list which correspond to the type arguments that are marked @Covariant.- Returns:
- whether
supertypeTypeArgscontainsubtypeTypeArgs
-
visitDeclared_Intersection
public Boolean visitDeclared_Intersection(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitDeclared_Intersectionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitDeclared_Intersectionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitDeclared_Null
public Boolean visitDeclared_Null(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitDeclared_Nullin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitDeclared_Nullin classAbstractAtmComboVisitor<Boolean,Void>
-
visitDeclared_Primitive
public Boolean visitDeclared_Primitive(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitDeclared_Primitivein interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitDeclared_Primitivein classAbstractAtmComboVisitor<Boolean,Void>
-
visitDeclared_Typevar
public Boolean visitDeclared_Typevar(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitDeclared_Typevarin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitDeclared_Typevarin classAbstractAtmComboVisitor<Boolean,Void>
-
visitDeclared_Union
public Boolean visitDeclared_Union(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) - Specified by:
visitDeclared_Unionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitDeclared_Unionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitDeclared_Wildcard
public Boolean visitDeclared_Wildcard(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitDeclared_Wildcardin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitDeclared_Wildcardin classAbstractAtmComboVisitor<Boolean,Void>
-
visitIntersection_Declared
public Boolean visitIntersection_Declared(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitIntersection_Declaredin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitIntersection_Declaredin classAbstractAtmComboVisitor<Boolean,Void>
-
visitIntersection_Primitive
public Boolean visitIntersection_Primitive(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitIntersection_Primitivein interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitIntersection_Primitivein classAbstractAtmComboVisitor<Boolean,Void>
-
visitIntersection_Intersection
public Boolean visitIntersection_Intersection(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitIntersection_Intersectionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitIntersection_Intersectionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitIntersection_Null
public Boolean visitIntersection_Null(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitIntersection_Nullin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitIntersection_Nullin classAbstractAtmComboVisitor<Boolean,Void>
-
visitIntersection_Typevar
public Boolean visitIntersection_Typevar(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitIntersection_Typevarin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitIntersection_Typevarin classAbstractAtmComboVisitor<Boolean,Void>
-
visitIntersection_Wildcard
public Boolean visitIntersection_Wildcard(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitIntersection_Wildcardin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitIntersection_Wildcardin classAbstractAtmComboVisitor<Boolean,Void>
-
visitNull_Array
public Boolean visitNull_Array(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitNull_Arrayin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitNull_Arrayin classAbstractAtmComboVisitor<Boolean,Void>
-
visitNull_Declared
public Boolean visitNull_Declared(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitNull_Declaredin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitNull_Declaredin classAbstractAtmComboVisitor<Boolean,Void>
-
visitNull_Typevar
public Boolean visitNull_Typevar(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitNull_Typevarin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitNull_Typevarin classAbstractAtmComboVisitor<Boolean,Void>
-
visitNull_Wildcard
public Boolean visitNull_Wildcard(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitNull_Wildcardin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitNull_Wildcardin classAbstractAtmComboVisitor<Boolean,Void>
-
visitNull_Null
public Boolean visitNull_Null(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitNull_Nullin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitNull_Nullin classAbstractAtmComboVisitor<Boolean,Void>
-
visitNull_Union
public Boolean visitNull_Union(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) - Specified by:
visitNull_Unionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitNull_Unionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitNull_Intersection
public Boolean visitNull_Intersection(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitNull_Intersectionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitNull_Intersectionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitNull_Primitive
public Boolean visitNull_Primitive(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitNull_Primitivein interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitNull_Primitivein classAbstractAtmComboVisitor<Boolean,Void>
-
visitPrimitive_Declared
public Boolean visitPrimitive_Declared(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitPrimitive_Declaredin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitPrimitive_Declaredin classAbstractAtmComboVisitor<Boolean,Void>
-
visitPrimitive_Primitive
public Boolean visitPrimitive_Primitive(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitPrimitive_Primitivein interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitPrimitive_Primitivein classAbstractAtmComboVisitor<Boolean,Void>
-
visitPrimitive_Intersection
public Boolean visitPrimitive_Intersection(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitPrimitive_Intersectionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitPrimitive_Intersectionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitPrimitive_Typevar
public Boolean visitPrimitive_Typevar(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitPrimitive_Typevarin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitPrimitive_Typevarin classAbstractAtmComboVisitor<Boolean,Void>
-
visitPrimitive_Wildcard
public Boolean visitPrimitive_Wildcard(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitPrimitive_Wildcardin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitPrimitive_Wildcardin classAbstractAtmComboVisitor<Boolean,Void>
-
visitUnion_Declared
public Boolean visitUnion_Declared(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitUnion_Declaredin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitUnion_Declaredin classAbstractAtmComboVisitor<Boolean,Void>
-
visitUnion_Intersection
public Boolean visitUnion_Intersection(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitUnion_Intersectionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitUnion_Intersectionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitUnion_Union
public Boolean visitUnion_Union(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) - Specified by:
visitUnion_Unionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitUnion_Unionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitUnion_Wildcard
public Boolean visitUnion_Wildcard(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitUnion_Wildcardin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitUnion_Wildcardin classAbstractAtmComboVisitor<Boolean,Void>
-
visitUnion_Typevar
public Boolean visitUnion_Typevar(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitUnion_Typevarin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitUnion_Typevarin classAbstractAtmComboVisitor<Boolean,Void>
-
visitTypevar_Declared
public Boolean visitTypevar_Declared(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitTypevar_Declaredin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitTypevar_Declaredin classAbstractAtmComboVisitor<Boolean,Void>
-
visitTypevar_Intersection
public Boolean visitTypevar_Intersection(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitTypevar_Intersectionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitTypevar_Intersectionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitTypevar_Primitive
public Boolean visitTypevar_Primitive(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitTypevar_Primitivein interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitTypevar_Primitivein classAbstractAtmComboVisitor<Boolean,Void>
-
visitTypevar_Array
public Boolean visitTypevar_Array(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitTypevar_Arrayin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitTypevar_Arrayin classAbstractAtmComboVisitor<Boolean,Void>
-
visitTypevar_Typevar
public Boolean visitTypevar_Typevar(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitTypevar_Typevarin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitTypevar_Typevarin classAbstractAtmComboVisitor<Boolean,Void>
-
visitTypevar_Null
public Boolean visitTypevar_Null(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitTypevar_Nullin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitTypevar_Nullin classAbstractAtmComboVisitor<Boolean,Void>
-
visitTypevar_Wildcard
public Boolean visitTypevar_Wildcard(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitTypevar_Wildcardin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitTypevar_Wildcardin classAbstractAtmComboVisitor<Boolean,Void>
-
visitWildcard_Array
public Boolean visitWildcard_Array(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitWildcard_Arrayin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitWildcard_Arrayin classAbstractAtmComboVisitor<Boolean,Void>
-
visitWildcard_Declared
public Boolean visitWildcard_Declared(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitWildcard_Declaredin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitWildcard_Declaredin classAbstractAtmComboVisitor<Boolean,Void>
-
visitWildcard_Intersection
public Boolean visitWildcard_Intersection(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitWildcard_Intersectionin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitWildcard_Intersectionin classAbstractAtmComboVisitor<Boolean,Void>
-
visitWildcard_Primitive
public Boolean visitWildcard_Primitive(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitWildcard_Primitivein interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitWildcard_Primitivein classAbstractAtmComboVisitor<Boolean,Void>
-
visitWildcard_Typevar
public Boolean visitWildcard_Typevar(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitWildcard_Typevarin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitWildcard_Typevarin classAbstractAtmComboVisitor<Boolean,Void>
-
visitWildcard_Wildcard
public Boolean visitWildcard_Wildcard(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitWildcard_Wildcardin interfaceAtmComboVisitor<Boolean,Void> - Overrides:
visitWildcard_Wildcardin classAbstractAtmComboVisitor<Boolean,Void>
-
visitType_Intersection
protected boolean visitType_Intersection(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype) An intersection is a supertype if all of its bounds are a supertype of subtype.- Parameters:
subtype- the possible subtypesupertype- the possible supertype- Returns:
- true
subtypeis a subtype ofsupertype
-
visitIntersection_Type
protected boolean visitIntersection_Type(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror supertype) An intersection is a subtype if one of its bounds is a subtype ofsupertype.- Parameters:
subtype- an intersection typesupertype- an annotated type- Returns:
- whether
subtypeis a subtype ofsupertype
-
visitType_Typevar
protected boolean visitType_Typevar(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype) A type variable is a supertype if its lower bound is above subtype.- Parameters:
subtype- a type that might be a subtypesupertype- a type that might be a supertype- Returns:
- true if
subtypeis a subtype ofsupertype
-
visitTypevar_Type
protected boolean visitTypevar_Type(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror supertype) A type variable is a subtype if its upper bound is below the supertype.- Parameters:
subtype- a type that might be a subtypesupertype- a type that might be a supertype- Returns:
- true if
subtypeis a subtype ofsupertype
-
visitUnion_Type
protected boolean visitUnion_Type(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror supertype) A union type is a subtype if ALL of its alternatives are subtypes of supertype.- Parameters:
subtype- the potential subtype to checksupertype- the supertype to check- Returns:
- whether all the alternatives of subtype are subtypes of supertype
-
visitType_Wildcard
protected boolean visitType_Wildcard(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype) Check a wildcard type's relation against a subtype.- Parameters:
subtype- the potential subtype to checksupertype- the wildcard supertype to check- Returns:
- whether the subtype is a subtype of the supertype's super bound
-
visitWildcard_Type
protected boolean visitWildcard_Type(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror supertype) Check a wildcard type's relation against a supertype.- Parameters:
subtype- the potential wildcard subtype to checksupertype- the supertype to check- Returns:
- whether the subtype's extends bound is a subtype of the supertype
-