checkers.util
Class DAGQualifierHierarchy

java.lang.Object
  extended by checkers.types.QualifierHierarchy
      extended by checkers.util.DAGQualifierHierarchy

public class DAGQualifierHierarchy
extends QualifierHierarchy

Represents the type qualifier hierarchy of a type system.


Nested Class Summary
static class DAGQualifierHierarchy.Factory
          Factory used to create an instance of DAGQualifierHierarchy.
 
Method Summary
 AnnotationMirror getRootAnnotation()
           
 Set<Name> getTypeQualifiers()
          Returns the names of all type qualifiers in this type qualifier hierarchy
 boolean inConflict(AnnotationMirror anno1, AnnotationMirror anno2)
          Check if the two annotations are in conflict.
 boolean isSubtype(AnnotationMirror anno1, AnnotationMirror anno2)
          Tests whether anno1 is a super qualifier anno2, according to the type qualifiers hierarchy.
 AnnotationMirror leastUpperBound(AnnotationMirror a1, AnnotationMirror a2)
          Returns the least upper bound for a1 and a2 qualifiers.
 
Methods inherited from class checkers.types.QualifierHierarchy
difference, intersect, isSubtype, leastUpperBound, validQualifier, validQualifiers, wrapCollection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRootAnnotation

public AnnotationMirror getRootAnnotation()
Specified by:
getRootAnnotation in class QualifierHierarchy
Returns:
the root (ultimate super) type qualifier in the hierarchy

getTypeQualifiers

public Set<Name> getTypeQualifiers()
Description copied from class: QualifierHierarchy
Returns the names of all type qualifiers in this type qualifier hierarchy

Specified by:
getTypeQualifiers in class QualifierHierarchy
Returns:
the fully qualified name represented in this hierarchy

inConflict

public boolean inConflict(AnnotationMirror anno1,
                          AnnotationMirror anno2)
Description copied from class: QualifierHierarchy
Check if the two annotations are in conflict. Two qualifiers are in conflict if both cannot annotate a type together.

Specified by:
inConflict in class QualifierHierarchy
Returns:
true iff anno1 and anno2 are in conflict

leastUpperBound

public AnnotationMirror leastUpperBound(AnnotationMirror a1,
                                        AnnotationMirror a2)
Description copied from class: QualifierHierarchy
Returns the least upper bound for a1 and a2 qualifiers. Examples: For NonNull, leastUpperBound('Nullable', 'NonNull') ==> Nullable For IGJ, leastUpperBound('Immutable', 'Mutable') ==> ReadOnly

Specified by:
leastUpperBound in class QualifierHierarchy
Returns:
the least restrictive qualifiers for both types

isSubtype

public boolean isSubtype(AnnotationMirror anno1,
                         AnnotationMirror anno2)
Description copied from class: QualifierHierarchy
Tests whether anno1 is a super qualifier anno2, according to the type qualifiers hierarchy.

Specified by:
isSubtype in class QualifierHierarchy
Returns:
true iff anno1 is a sub qualifier of anno2