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
Modifier and TypeFieldDescriptionprotected final StructuralEqualityVisitHistory
Stores the result ofareEqualInHierarchy(AnnotatedTypeMirror, AnnotatedTypeMirror)
for type arguments.protected final BaseTypeChecker
The type-checker that is associated with this.protected AnnotationMirror
The top annotation of the hierarchy currently being checked.protected final StructuralEqualityComparer
The equality comparer.protected final boolean
Whether to ignore raw types.protected final boolean
Whether to make array subtyping invariant with respect to array component types.protected final SubtypeVisitHistory
Stores the result of isSubtype, if that result is true.protected final QualifierHierarchy
The qualifier hierarchy that is associated with this. -
Constructor Summary
ConstructorDescriptionDefaultTypeHierarchy
(BaseTypeChecker checker, QualifierHierarchy qualHierarchy, boolean ignoreRawTypes, boolean invariantArrayComponents) Creates a DefaultTypeHierarchy. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
areAllSubtypes
(Iterable<? extends AnnotatedTypeMirror> subtypes, AnnotatedTypeMirror supertype) Are all the types insubtypes
a subtype ofsupertype
?protected boolean
areEqualInHierarchy
(AnnotatedTypeMirror type1, AnnotatedTypeMirror type2) protected StructuralEqualityComparer
Create 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 boolean
isContainedBy
(AnnotatedTypeMirror inside, AnnotatedTypeMirror outside, boolean canBeCovariant) Returns true ifoutside
containsinside
, that is, if the set of types denoted byoutside
is a superset of, or equal to, the set of types denoted byinside
.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.protected boolean
isContainedWithinBounds
(AnnotatedTypeMirror inside, AnnotatedTypeMirror outsideLower, AnnotatedTypeMirror outsideUpper, boolean canBeCovariant) Letoutside
be? super outsideLower extends outsideUpper
.protected boolean
isPrimarySubtype
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) Compare the primary annotations ofsubtype
andsupertype
.boolean
isSubtype
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) Returns true if subtype <: supertype.protected boolean
isSubtype
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror top) Returns true ifsubtype <: supertype
, but only for the hierarchy of whichtop
is the top.protected boolean
isSubtypeCaching
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) LikeisSubtype(AnnotatedTypeMirror, AnnotatedTypeMirror)
, but uses a cache to prevent infinite recursion on recursive types.boolean
isSubtypeShallowEffective
(Collection<? extends AnnotationMirror> subQualifiers, AnnotatedTypeMirror supertype) Tests whethersubQualifiers
are equal to or are sub-qualifiers of the effective annotations ofsupertype
, according to the type qualifier hierarchy.boolean
isSubtypeShallowEffective
(AnnotationMirror subQualifier, AnnotatedTypeMirror supertype) Tests whethersubQualifier
is equal to or sub-qualifier of the effective annotation ofsupertype
in the same hierarchy assubQualifier
according to the type qualifier hierarchy.boolean
isSubtypeShallowEffective
(AnnotatedTypeMirror subtype, Collection<? extends AnnotationMirror> superQualifiers) Tests whether the effective annotations ofsubtype
are equal to or are sub-qualifiers ofsuperQualifiers
, according to the type qualifier hierarchy.boolean
isSubtypeShallowEffective
(AnnotatedTypeMirror subtype, AnnotationMirror superQualifier) Tests whether the effective annotation ofsubtype
in the same hierarchy assuperQualifier
is equal to or sub-qualifier ofsuperQualifier
, according to the type qualifier hierarchy.boolean
isSubtypeShallowEffective
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype) Tests whether the effective annotations ofsubtype
are equal to or are sub-qualifiers of the effective annotations ofsupertype
, according to the type qualifier hierarchy.boolean
isSubtypeShallowEffective
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror hierarchy) Tests whether the effective annotation in the same hierarchy ashierarchy
ofsubtype
are equal to or are sub-qualifiers of the effective annotation ofsupertype
in 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 boolean
visitIntersection_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 boolean
visitType_Intersection
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype) An intersection is a supertype if all of its bounds are a supertype of subtype.protected boolean
visitType_Typevar
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype) A type variable is a supertype if its lower bound is above subtype.protected boolean
visitType_Wildcard
(AnnotatedTypeMirror subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype) Check a wildcard type's relation against a subtype.protected boolean
visitTypeArgs
(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, boolean subtypeRaw, boolean supertypeRaw) Returns true if the type arguments insupertype
contain the type arguments insubtype
and 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 boolean
visitTypevar_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 boolean
visitUnion_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 boolean
visitWildcard_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_Union
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 thevisitXXX
methods.- Specified by:
isSubtype
in 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:TypeHierarchy
Tests whether the effective annotations ofsubtype
are equal to or are sub-qualifiers of the effective annotations ofsupertype
, according to the type qualifier hierarchy.The underlying types of
subtype
andsupertype
are 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:
isSubtypeShallowEffective
in interfaceTypeHierarchy
- Parameters:
subtype
- possible subtypesupertype
- possible supertype- Returns:
- true iff the effective annotations of
subtype
are 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:TypeHierarchy
Tests whether the effective annotation in the same hierarchy ashierarchy
ofsubtype
are equal to or are sub-qualifiers of the effective annotation ofsupertype
in the same hierarchy ashierarchy
, according to the type qualifier hierarchy. Other annotations insubtype
andsupertype
are ignored.The underlying types of
subtype
andsupertype
are 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:
isSubtypeShallowEffective
in interfaceTypeHierarchy
- Parameters:
subtype
- possible subtypesupertype
- possible supertypehierarchy
- an annotation whose hierarchy is used to comparesubtype
andsupertype
- Returns:
- true iff the effective annotation in the same hierarchy as
hierarchy
ofsubtype
are equal to or are sub-qualifiers of the effective annotation ofsupertype
in the same hierarchy ashierarchy
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(AnnotatedTypeMirror subtype, Collection<? extends AnnotationMirror> superQualifiers) Description copied from interface:TypeHierarchy
Tests whether the effective annotations ofsubtype
are equal to or are sub-qualifiers ofsuperQualifiers
, according to the type qualifier hierarchy. Other annotations insubtype
are ignored.The underlying type of
subtype
is only used by this method for special cases when qualifier subtyping depends on the Java basetype.- Specified by:
isSubtypeShallowEffective
in interfaceTypeHierarchy
- Parameters:
subtype
- possible subtypesuperQualifiers
- possible superQualifiers- Returns:
- true iff the effective annotations of
subtype
are equal to or are sub-qualifiers ofsuperQualifiers
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(Collection<? extends AnnotationMirror> subQualifiers, AnnotatedTypeMirror supertype) Description copied from interface:TypeHierarchy
Tests whethersubQualifiers
are equal to or are sub-qualifiers of the effective annotations ofsupertype
, according to the type qualifier hierarchy. Other annotations insupertype
are ignored.The underlying type of
supertype
is used by this method for special cases when qualifier subtyping depends on the Java basetype.- Specified by:
isSubtypeShallowEffective
in interfaceTypeHierarchy
- Parameters:
subQualifiers
- possible subQualifierssupertype
- possible supertype- Returns:
- true iff
subQualifiers
are equal to or are sub-qualifiers of the effective annotations ofsupertype
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(AnnotatedTypeMirror subtype, AnnotationMirror superQualifier) Description copied from interface:TypeHierarchy
Tests whether the effective annotation ofsubtype
in the same hierarchy assuperQualifier
is equal to or sub-qualifier ofsuperQualifier
, according to the type qualifier hierarchy. The underlying types ofsubtype
is only used by this method for special cases when qualifier subtyping depends on the Java basetype. Other annotations insubtype
are ignored.- Specified by:
isSubtypeShallowEffective
in interfaceTypeHierarchy
- Parameters:
subtype
- possible subtypesuperQualifier
- possible super qualifier- Returns:
- true iffhe effective annotation of
subtype
in the same hierarchy assuperQualifier
is equal to or sub-qualifier ofsuperQualifier
-
isSubtypeShallowEffective
public boolean isSubtypeShallowEffective(AnnotationMirror subQualifier, AnnotatedTypeMirror supertype) Description copied from interface:TypeHierarchy
Tests whethersubQualifier
is equal to or sub-qualifier of the effective annotation ofsupertype
in the same hierarchy assubQualifier
according to the type qualifier hierarchy. The underlying types ofsupertype
is only used by this method for special cases when qualifier subtyping depends on the Java basetype. Other annotations insupertype
are ignored.- Specified by:
isSubtypeShallowEffective
in interfaceTypeHierarchy
- Parameters:
subQualifier
- possible subQualifiersupertype
- possible supertype- Returns:
- true
subQualifier
is equal to or sub-qualifier of the effective annotation ofsupertype
in the same hierarchy assubQualifier
-
isSubtype
protected boolean isSubtype(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype, AnnotationMirror top) Returns true ifsubtype <: supertype
, but only for the hierarchy of whichtop
is the top.- Parameters:
subtype
- expected subtypesupertype
- expected supertypetop
- the top of the hierarchy for which we want to make a comparison- Returns:
- true if
subtype
is 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:
defaultErrorMessage
in 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 ofsubtype
andsupertype
. 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 insubtypes
a subtype ofsupertype
?The underlying type mirrors of
subtypes
must be subtypes of the underlying type mirror ofsupertype
. -
areEqualInHierarchy
-
isContainedBy
protected boolean isContainedBy(AnnotatedTypeMirror inside, AnnotatedTypeMirror outside, boolean canBeCovariant) Returns true ifoutside
containsinside
, that is, if the set of types denoted byoutside
is 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) Letoutside
be? super outsideLower extends outsideUpper
. Returns true ifoutside
containsinside
, that is, if the set of types denoted byoutside
is 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_Array
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitArray_Array
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitArray_Declared
public Boolean visitArray_Declared(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitArray_Declared
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitArray_Declared
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitArray_Null
public Boolean visitArray_Null(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitArray_Null
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitArray_Null
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitArray_Intersection
public Boolean visitArray_Intersection(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitArray_Intersection
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitArray_Intersection
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitArray_Wildcard
public Boolean visitArray_Wildcard(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitArray_Wildcard
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitArray_Wildcard
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitArray_Typevar
public Boolean visitArray_Typevar(AnnotatedTypeMirror.AnnotatedArrayType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable superType, Void p) - Specified by:
visitArray_Typevar
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitArray_Typevar
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitDeclared_Array
public Boolean visitDeclared_Array(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitDeclared_Array
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitDeclared_Array
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitDeclared_Declared
public Boolean visitDeclared_Declared(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitDeclared_Declared
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitDeclared_Declared
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitTypeArgs
protected boolean visitTypeArgs(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, boolean subtypeRaw, boolean supertypeRaw) Returns true if the type arguments insupertype
contain the type arguments insubtype
and 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
- whethersubtype
is a raw typesupertypeRaw
- whethersupertype
is a raw type- Returns:
- true if the type arguments in
supertype
contain the type arguments insubtype
and false otherwise
-
getCovariantArgIndexes
Description copied from interface:TypeHierarchy
Returns a list of the indices of the type arguments that are covariant.- Specified by:
getCovariantArgIndexes
in 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 insupertypeTypeArgs
contains 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
supertypeTypeArgs
containsubtypeTypeArgs
-
visitDeclared_Intersection
public Boolean visitDeclared_Intersection(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitDeclared_Intersection
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitDeclared_Intersection
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitDeclared_Null
public Boolean visitDeclared_Null(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitDeclared_Null
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitDeclared_Null
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitDeclared_Primitive
public Boolean visitDeclared_Primitive(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitDeclared_Primitive
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitDeclared_Primitive
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitDeclared_Typevar
public Boolean visitDeclared_Typevar(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitDeclared_Typevar
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitDeclared_Typevar
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitDeclared_Union
public Boolean visitDeclared_Union(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) - Specified by:
visitDeclared_Union
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitDeclared_Union
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitDeclared_Wildcard
public Boolean visitDeclared_Wildcard(AnnotatedTypeMirror.AnnotatedDeclaredType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitDeclared_Wildcard
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitDeclared_Wildcard
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitIntersection_Declared
public Boolean visitIntersection_Declared(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitIntersection_Declared
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitIntersection_Declared
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitIntersection_Primitive
public Boolean visitIntersection_Primitive(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitIntersection_Primitive
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitIntersection_Primitive
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitIntersection_Intersection
public Boolean visitIntersection_Intersection(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitIntersection_Intersection
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitIntersection_Intersection
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitIntersection_Null
public Boolean visitIntersection_Null(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitIntersection_Null
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitIntersection_Null
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitIntersection_Typevar
public Boolean visitIntersection_Typevar(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitIntersection_Typevar
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitIntersection_Typevar
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitIntersection_Wildcard
public Boolean visitIntersection_Wildcard(AnnotatedTypeMirror.AnnotatedIntersectionType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitIntersection_Wildcard
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitIntersection_Wildcard
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitNull_Array
public Boolean visitNull_Array(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitNull_Array
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitNull_Array
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitNull_Declared
public Boolean visitNull_Declared(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitNull_Declared
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitNull_Declared
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitNull_Typevar
public Boolean visitNull_Typevar(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitNull_Typevar
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitNull_Typevar
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitNull_Wildcard
public Boolean visitNull_Wildcard(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitNull_Wildcard
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitNull_Wildcard
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitNull_Null
public Boolean visitNull_Null(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitNull_Null
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitNull_Null
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitNull_Union
public Boolean visitNull_Union(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) - Specified by:
visitNull_Union
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitNull_Union
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitNull_Intersection
public Boolean visitNull_Intersection(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitNull_Intersection
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitNull_Intersection
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitNull_Primitive
public Boolean visitNull_Primitive(AnnotatedTypeMirror.AnnotatedNullType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitNull_Primitive
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitNull_Primitive
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitPrimitive_Declared
public Boolean visitPrimitive_Declared(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitPrimitive_Declared
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitPrimitive_Declared
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitPrimitive_Primitive
public Boolean visitPrimitive_Primitive(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitPrimitive_Primitive
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitPrimitive_Primitive
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitPrimitive_Intersection
public Boolean visitPrimitive_Intersection(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitPrimitive_Intersection
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitPrimitive_Intersection
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitPrimitive_Typevar
public Boolean visitPrimitive_Typevar(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitPrimitive_Typevar
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitPrimitive_Typevar
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitPrimitive_Wildcard
public Boolean visitPrimitive_Wildcard(AnnotatedTypeMirror.AnnotatedPrimitiveType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitPrimitive_Wildcard
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitPrimitive_Wildcard
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitUnion_Declared
public Boolean visitUnion_Declared(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitUnion_Declared
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitUnion_Declared
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitUnion_Intersection
public Boolean visitUnion_Intersection(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitUnion_Intersection
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitUnion_Intersection
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitUnion_Union
public Boolean visitUnion_Union(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedUnionType supertype, Void p) - Specified by:
visitUnion_Union
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitUnion_Union
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitUnion_Wildcard
public Boolean visitUnion_Wildcard(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitUnion_Wildcard
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitUnion_Wildcard
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitUnion_Typevar
public Boolean visitUnion_Typevar(AnnotatedTypeMirror.AnnotatedUnionType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitUnion_Typevar
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitUnion_Typevar
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitTypevar_Declared
public Boolean visitTypevar_Declared(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitTypevar_Declared
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitTypevar_Declared
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitTypevar_Intersection
public Boolean visitTypevar_Intersection(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitTypevar_Intersection
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitTypevar_Intersection
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitTypevar_Primitive
public Boolean visitTypevar_Primitive(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitTypevar_Primitive
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitTypevar_Primitive
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitTypevar_Array
public Boolean visitTypevar_Array(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitTypevar_Array
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitTypevar_Array
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitTypevar_Typevar
public Boolean visitTypevar_Typevar(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitTypevar_Typevar
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitTypevar_Typevar
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitTypevar_Null
public Boolean visitTypevar_Null(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedNullType supertype, Void p) - Specified by:
visitTypevar_Null
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitTypevar_Null
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitTypevar_Wildcard
public Boolean visitTypevar_Wildcard(AnnotatedTypeMirror.AnnotatedTypeVariable subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitTypevar_Wildcard
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitTypevar_Wildcard
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitWildcard_Array
public Boolean visitWildcard_Array(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedArrayType supertype, Void p) - Specified by:
visitWildcard_Array
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitWildcard_Array
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitWildcard_Declared
public Boolean visitWildcard_Declared(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedDeclaredType supertype, Void p) - Specified by:
visitWildcard_Declared
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitWildcard_Declared
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitWildcard_Intersection
public Boolean visitWildcard_Intersection(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedIntersectionType supertype, Void p) - Specified by:
visitWildcard_Intersection
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitWildcard_Intersection
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitWildcard_Primitive
public Boolean visitWildcard_Primitive(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedPrimitiveType supertype, Void p) - Specified by:
visitWildcard_Primitive
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitWildcard_Primitive
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitWildcard_Typevar
public Boolean visitWildcard_Typevar(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedTypeVariable supertype, Void p) - Specified by:
visitWildcard_Typevar
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitWildcard_Typevar
in classAbstractAtmComboVisitor<Boolean,
Void>
-
visitWildcard_Wildcard
public Boolean visitWildcard_Wildcard(AnnotatedTypeMirror.AnnotatedWildcardType subtype, AnnotatedTypeMirror.AnnotatedWildcardType supertype, Void p) - Specified by:
visitWildcard_Wildcard
in interfaceAtmComboVisitor<Boolean,
Void> - Overrides:
visitWildcard_Wildcard
in 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
subtype
is 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
subtype
is 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
subtype
is 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
subtype
is 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
-