checkers.util
Class DAGQualifierHierarchy.Factory

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

public static class DAGQualifierHierarchy.Factory
extends Object

Factory used to create an instance of DAGQualifierHierarchy. A factory can be used to create at most one DAGQualifierHierarchy. 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
DAGQualifierHierarchy.Factory()
           
DAGQualifierHierarchy.Factory(DAGQualifierHierarchy hierarchy)
          Creates a factory for a hierarchy that initalized to be a copy of the passed hierarchy.
 
Method Summary
 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.
 DAGQualifierHierarchy build()
          Returns an instance of DAGQualifierHierarchy that represent 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

DAGQualifierHierarchy.Factory

public DAGQualifierHierarchy.Factory(DAGQualifierHierarchy hierarchy)
Creates a factory for a hierarchy that initalized to be a copy of the passed hierarchy.


DAGQualifierHierarchy.Factory

public DAGQualifierHierarchy.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 DAGQualifierHierarchy build()
Returns an instance of DAGQualifierHierarchy that represent the hierarchy built so far