public class MultiGraphQualifierHierarchy extends QualifierHierarchy
MultiGraphQualifierHierarchy.MultiGraphFactory
.
A QualifierHierarchy that supports multiple separate subtype hierarchies.Modifier and Type | Class and Description |
---|---|
static class |
MultiGraphQualifierHierarchy.MultiGraphFactory
Factory used to create an instance of
GraphQualifierHierarchy . |
Modifier and Type | Field and Description |
---|---|
protected Set<@Nullable AnnotationMirror> |
bottoms
The bottom qualifiers of the type hierarchies.
|
protected @Nullable AnnotationMirror |
polymorphicQualifier
Reference to the special qualifier checkers.quals.PolymorphicQualifier.
|
protected Map<@Nullable AnnotationMirror,@Nullable AnnotationMirror> |
polyQualifiers |
protected Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> |
supertypesGraph
The declared, direct supertypes for each qualifier, without added
transitive relations.
|
protected Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> |
supertypesMap
The transitive closure of the supertypesGraph.
|
protected Set<@Nullable AnnotationMirror> |
tops
The top qualifiers of the individual type hierarchies.
|
Constructor and Description |
---|
MultiGraphQualifierHierarchy(MultiGraphQualifierHierarchy.MultiGraphFactory f) |
MultiGraphQualifierHierarchy(MultiGraphQualifierHierarchy.MultiGraphFactory f,
Object... args) |
findCorrespondingAnnotation, greatestLowerBounds, leastUpperBounds
protected final Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> supertypesGraph
protected final Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> supertypesMap
protected final Set<@Nullable AnnotationMirror> tops
protected final Set<@Nullable AnnotationMirror> bottoms
protected final @Nullable AnnotationMirror polymorphicQualifier
protected final Map<@Nullable AnnotationMirror,@Nullable AnnotationMirror> polyQualifiers
public MultiGraphQualifierHierarchy(MultiGraphQualifierHierarchy.MultiGraphFactory f)
public MultiGraphQualifierHierarchy(MultiGraphQualifierHierarchy.MultiGraphFactory f, Object... args)
protected void finish(AnnotationUtils annoFactory, QualifierHierarchy qualHierarchy, Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> fullMap, Map<@Nullable AnnotationMirror,@Nullable AnnotationMirror> polyQualifiers, Set<@Nullable AnnotationMirror> tops, Set<@Nullable AnnotationMirror> bottoms, Object... args)
public Set<@Nullable AnnotationMirror> getTopAnnotations()
getTopAnnotations
in class QualifierHierarchy
public @Nullable AnnotationMirror getTopAnnotation(@Nullable AnnotationMirror start)
QualifierHierarchy
getTopAnnotation
in class QualifierHierarchy
public @Nullable AnnotationMirror getBottomAnnotation(@Nullable AnnotationMirror start)
QualifierHierarchy
getBottomAnnotation
in class QualifierHierarchy
public Set<@Nullable AnnotationMirror> getBottomAnnotations()
getBottomAnnotations
in class QualifierHierarchy
public @Nullable AnnotationMirror getPolymorphicAnnotation(@Nullable AnnotationMirror start)
getPolymorphicAnnotation
in class QualifierHierarchy
start
- Any qualifier from the type hierarchy.public boolean isSubtype(Collection<@Nullable AnnotationMirror> rhs, Collection<@Nullable AnnotationMirror> lhs)
QualifierHierarchy
isSubtype
in class QualifierHierarchy
public Set<@Nullable Name> getTypeQualifiers()
QualifierHierarchy
BaseTypeChecker.getSupportedTypeQualifiers()
?getTypeQualifiers
in class QualifierHierarchy
public @Nullable AnnotationMirror leastUpperBound(@Nullable AnnotationMirror a1, @Nullable AnnotationMirror a2)
QualifierHierarchy
leastUpperBound
in class QualifierHierarchy
public @Nullable AnnotationMirror greatestLowerBound(@Nullable AnnotationMirror a1, @Nullable AnnotationMirror a2)
QualifierHierarchy
greatestLowerBound
in class QualifierHierarchy
a1
- First annotationa2
- Second annotationpublic boolean isSubtype(@Nullable AnnotationMirror anno1, @Nullable AnnotationMirror anno2)
@I
.isSubtype
in class QualifierHierarchy
protected Set<@Nullable AnnotationMirror> findTops(Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> supertypes)
protected Set<@Nullable AnnotationMirror> findBottoms(Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> supertypes)
protected Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> buildFullMap(Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> supertypes)
protected void addPolyRelations(AnnotationUtils annoFactory, QualifierHierarchy qualHierarchy, Map<@Nullable AnnotationMirror,Set<@Nullable AnnotationMirror>> fullMap, Map<@Nullable AnnotationMirror,@Nullable AnnotationMirror> polyQualifiers, Set<@Nullable AnnotationMirror> tops, Set<@Nullable AnnotationMirror> bottoms)
PolyNull
for example)
1. a subtype of the top qualifier (e.g. Nullable
)
2. a supertype of all the bottom qualifiers (e.g. NonNull
)
Field supertypesMap is not set yet when this method is called - use fullMap instead.