protected class AccumulationAnnotatedTypeFactory.AccumulationQualifierHierarchy extends ElementQualifierHierarchy
acc() / \ acc(x) acc(y) ... \ / acc(x,y) ... | bottomPredicate subtyping is defined as follows:
Acc(A)
is a subtype of AccPred("A || B")
, because when A is replaced with true
and B is replaced with
false
, the resulting boolean formula evaluates to true.
AccumulationAnnotatedTypeFactory.isPredicateSubtype(String, String)
) is provided to allow more complex
subtyping behavior between predicates. (The "correct" subtyping rule is that P is a
subtype of Q iff P implies Q. That rule would require an SMT solver in the general
case, which is undesirable because it would require an external dependency. A user can
override AccumulationAnnotatedTypeFactory.isPredicateSubtype(String, String)
if they require more precise
subtyping; the check described here is overly conservative (and therefore sound), but
not very precise.)
bottoms, bottomsMap, kindToElementlessQualifier, qualifierKindHierarchy, tops, topsMap
Modifier | Constructor and Description |
---|---|
protected |
AccumulationQualifierHierarchy(Collection<Class<? extends Annotation>> qualifierClasses,
Elements elements)
Creates a ElementQualifierHierarchy from the given classes.
|
Modifier and Type | Method and Description |
---|---|
AnnotationMirror |
greatestLowerBound(AnnotationMirror a1,
AnnotationMirror a2)
GLB in this type system is set union of the arguments of the two annotations, unless one
of them is bottom, in which case the result is also bottom.
|
boolean |
isSubtype(AnnotationMirror subAnno,
AnnotationMirror superAnno)
isSubtype in this type system is subset.
|
AnnotationMirror |
leastUpperBound(AnnotationMirror a1,
AnnotationMirror a2)
LUB in this type system is set intersection of the arguments of the two annotations,
unless one of them is bottom, in which case the result is the other annotation.
|
createBottomsMap, createElementlessQualifierMap, createQualifierKindHierarchy, createTopsMap, findAnnotationInHierarchy, findAnnotationInSameHierarchy, getBottomAnnotation, getBottomAnnotations, getPolymorphicAnnotation, getQualifierKind, getQualifierKind, getTopAnnotation, getTopAnnotations, isPolymorphicQualifier, isValid
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
assertSameSize, assertSameSize, canHaveEmptyAnnotationSet, getWidth, greatestLowerBound, greatestLowerBounds, greatestLowerBounds, greatestLowerBoundsTypeVariable, greatestLowerBoundTypeVariable, isSubtype, isSubtype, isSubtype, isSubtypeTypeVariable, isSubtypeTypeVariable, leastUpperBound, leastUpperBounds, leastUpperBounds, leastUpperBoundsTypeVariable, leastUpperBoundTypeVariable, numberOfIterationsBeforeWidening, updateMappingToMutableSet, widenedUpperBound
protected AccumulationQualifierHierarchy(Collection<Class<? extends Annotation>> qualifierClasses, Elements elements)
qualifierClasses
- classes of annotations that are the qualifiers for this hierarchyelements
- element utilspublic AnnotationMirror greatestLowerBound(AnnotationMirror a1, AnnotationMirror a2)
a1
- first qualifiera2
- second qualifierpublic AnnotationMirror leastUpperBound(AnnotationMirror a1, AnnotationMirror a2)
a1
- the first qualifier; may not be in the same hierarchy as qualifier2
a2
- the second qualifier; may not be in the same hierarchy as qualifier1
null
if the qualifiers are from
different hierarchiespublic boolean isSubtype(AnnotationMirror subAnno, AnnotationMirror superAnno)
subAnno
- possible subqualifier of superQualifier
superAnno
- possible superqualifier of subQualifier
subQualifier
is a subqualifier of, or equal to, superQualifier