checkers.util
Class GraphQualifierHierarchy.Factory

java.lang.Object
  extended by checkers.util.GraphQualifierHierarchy.Factory
Enclosing class:
GraphQualifierHierarchy

public static class GraphQualifierHierarchy.Factory
extends Object

Factory used to create an instance of GraphQualifierHierarchy. A factory can be used to create at most one GraphQualifierHierarchy. To create a hierarchy, a client may do so in three steps: 1. add qualifiers using addQualifier(AnnotationMirror); 2. add subtype relations using addSubtype(AnnotationMirror, AnnotationMirror) 3. build the hierarchy and gets using build(). Notice that addSubtype(AnnotationMirror, AnnotationMirror) adds the two qualifiers to the hierarchy if they are not already in. Also, once the client builds a hierarchy through build(), no further modifications are allowed nor can it making a new instance. Clients build the hierarchy using addQualifier(AnnotationMirror) and addSubtype(AnnotationMirror, AnnotationMirror), then get the instance with calling build()


Constructor Summary
Constructor and Description
GraphQualifierHierarchy.Factory()
           
 
Method Summary
Modifier and Type Method and Description
 void addQualifier(AnnotationMirror qual)
          Adds the passed qualifier to the hierarchy.
 void addSubtype(AnnotationMirror sub, AnnotationMirror sup)
          Adds a subtype relationship between the two type qualifiers.
 GraphQualifierHierarchy build()
          Returns an instance of GraphQualifierHierarchy that represents the hierarchy built so far
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphQualifierHierarchy.Factory

public GraphQualifierHierarchy.Factory()
Method Detail

addQualifier

public void addQualifier(AnnotationMirror qual)
Adds the passed qualifier to the hierarchy. Clients need to specify its super qualifiers in subsequent calls to addSubtype(AnnotationMirror, AnnotationMirror).


addSubtype

public void addSubtype(AnnotationMirror sub,
                       AnnotationMirror sup)
Adds a subtype relationship between the two type qualifiers.

Parameters:
sub - the sub type qualifier
sup - the super type qualifier

build

public GraphQualifierHierarchy build()
Returns an instance of GraphQualifierHierarchy that represents the hierarchy built so far