Class ClassValAnnotatedTypeFactory.ClassValQualifierHierarchy
java.lang.Object
org.checkerframework.framework.type.ElementQualifierHierarchy
org.checkerframework.common.reflection.ClassValAnnotatedTypeFactory.ClassValQualifierHierarchy
- All Implemented Interfaces:
QualifierHierarchy
- Enclosing class:
- ClassValAnnotatedTypeFactory
protected class ClassValAnnotatedTypeFactory.ClassValQualifierHierarchy
extends ElementQualifierHierarchy
The qualifier hierarchy for the ClassVal type system.
-
Field Summary
Fields inherited from class org.checkerframework.framework.type.ElementQualifierHierarchy
bottoms, bottomsMap, kindToElementlessQualifier, qualifierKindHierarchy, tops, topsMap
-
Constructor Summary
ConstructorDescriptionClassValQualifierHierarchy
(Set<Class<? extends Annotation>> qualifierClasses, Elements elements) Creates a ClassValQualifierHierarchy from the given classes. -
Method Summary
Modifier and TypeMethodDescriptionReturns the greatest lower bound for the qualifiers qualifier1 and qualifier2.boolean
isSubtype
(AnnotationMirror subAnno, AnnotationMirror superAnno) Tests whethersubQualifier
is equal to or a sub-qualifier ofsuperQualifier
, according to the type qualifier hierarchy.Returns the least upper bound (LUB) of the qualifiersqualifier1
andqualifier2
.Methods inherited from class org.checkerframework.framework.type.ElementQualifierHierarchy
createBottomsMap, createElementlessQualifierMap, createQualifierKindHierarchy, createTopsMap, findAnnotationInHierarchy, findAnnotationInSameHierarchy, getBottomAnnotation, getBottomAnnotations, getPolymorphicAnnotation, getQualifierKind, getQualifierKind, getTopAnnotation, getTopAnnotations, isPolymorphicQualifier, isValid
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.QualifierHierarchy
getWidth, greatestLowerBounds, isSubtype, leastUpperBounds, numberOfIterationsBeforeWidening, updateMappingToMutableSet, widenedUpperBound
-
Constructor Details
-
ClassValQualifierHierarchy
public ClassValQualifierHierarchy(Set<Class<? extends Annotation>> qualifierClasses, Elements elements) Creates a ClassValQualifierHierarchy from the given classes.- Parameters:
qualifierClasses
- classes of annotations that are the qualifiers for this hierarchyelements
- element utils
-
-
Method Details
-
leastUpperBound
Description copied from interface:QualifierHierarchy
Returns the least upper bound (LUB) of the qualifiersqualifier1
andqualifier2
. Returnsnull
if the qualifiers are not from the same qualifier hierarchy.Examples:
- For NonNull, leastUpperBound('Nullable', 'NonNull') ⇒ Nullable
- Parameters:
a1
- the first qualifier; may not be in the same hierarchy asqualifier2
a2
- the second qualifier; may not be in the same hierarchy asqualifier1
- Returns:
- the least upper bound of the qualifiers, or
null
if the qualifiers are from different hierarchies
-
greatestLowerBound
Description copied from interface:QualifierHierarchy
Returns the greatest lower bound for the qualifiers qualifier1 and qualifier2. Returns null if the qualifiers are not from the same qualifier hierarchy.- Parameters:
a1
- first qualifiera2
- second qualifier- Returns:
- greatest lower bound of the two annotations or null if the two annotations are not from the same hierarchy
-
isSubtype
Description copied from interface:QualifierHierarchy
Tests whethersubQualifier
is equal to or a sub-qualifier ofsuperQualifier
, according to the type qualifier hierarchy.- Parameters:
subAnno
- possible subqualifier ofsuperQualifier
superAnno
- possible superqualifier ofsubQualifier
- Returns:
- true iff
subQualifier
is a subqualifier of, or equal to,superQualifier
-