public class ConstraintMap extends Object
target -> constraints for target
)
b) Methods to easily build up the constraints in the map
c) A getter for the constraints of individual targets.
Note: This class, along with TargetConstraints, uses a lot of mutable state and few setters/getters
be careful. This choice was made as it makes the resulting code more readable.Constructor and Description |
---|
ConstraintMap(ConstraintMap toCopy) |
ConstraintMap(Set<TypeVariable> targets) |
Modifier and Type | Method and Description |
---|---|
void |
addPrimaryEqualities(TypeVariable target,
QualifierHierarchy qualHierarchy,
Set<AnnotationMirror> annos)
Add a constraint indicating that target has primary annotations equal to the given annotations
|
void |
addPrimarySubtypes(TypeVariable target,
QualifierHierarchy qualifierHierarchy,
Set<AnnotationMirror> annos)
Add a constraint indicating that target's primary annotations are subtypes of the given annotations
|
void |
addPrimarySupertype(TypeVariable target,
QualifierHierarchy qualifierHierarchy,
Set<AnnotationMirror> annos)
Add a constraint indicating that target's primary annotations are subtypes of the given annotations
|
void |
addTargetEquality(TypeVariable target,
TypeVariable equivalent,
Set<AnnotationMirror> hierarchies)
Add a constraint indicating that the equivalent is equal to target in the given qualifier hierarchies
|
void |
addTargetSubtype(TypeVariable target,
TypeVariable supertype,
Set<AnnotationMirror> hierarchies)
Add a constraint indicating that target is a subtype of supertype in the given qualifier hierarchies
|
void |
addTargetSupertype(TypeVariable target,
TypeVariable subtype,
Set<AnnotationMirror> hierarchies)
Add a constraint indicating that target is a supertype of subtype in the given qualifier hierarchies
|
void |
addTypeEqualities(TypeVariable target,
AnnotatedTypeMirror type,
Set<AnnotationMirror> hierarchies)
Add a constraint indicating that target is equal to type in the given hierarchies
|
void |
addTypeSubtype(TypeVariable target,
AnnotatedTypeMirror supertype,
Set<AnnotationMirror> hierarchies)
Add a constraint indicating that target is a subtype of supertype in the given qualifier hierarchies
|
void |
addTypeSupertype(TypeVariable target,
AnnotatedTypeMirror subtype,
Set<AnnotationMirror> hierarchies)
Add a constraint indicating that target is a supertype of subtype in the given qualifier hierarchies
|
TargetConstraints |
getConstraints(TypeVariable target)
Gets the equality, subtypes, and supertypes constraints for a particular target
|
Set<TypeVariable> |
getTargets() |
public ConstraintMap(Set<TypeVariable> targets)
public ConstraintMap(ConstraintMap toCopy)
public TargetConstraints getConstraints(TypeVariable target)
public Set<TypeVariable> getTargets()
public void addTargetEquality(TypeVariable target, TypeVariable equivalent, Set<AnnotationMirror> hierarchies)
public void addPrimaryEqualities(TypeVariable target, QualifierHierarchy qualHierarchy, Set<AnnotationMirror> annos)
public void addTargetSupertype(TypeVariable target, TypeVariable subtype, Set<AnnotationMirror> hierarchies)
hierarchies
- a set of TOP annotationspublic void addTypeSupertype(TypeVariable target, AnnotatedTypeMirror subtype, Set<AnnotationMirror> hierarchies)
hierarchies
- a set of TOP annotationspublic void addPrimarySupertype(TypeVariable target, QualifierHierarchy qualifierHierarchy, Set<AnnotationMirror> annos)
public void addTargetSubtype(TypeVariable target, TypeVariable supertype, Set<AnnotationMirror> hierarchies)
hierarchies
- a set of TOP annotationspublic void addTypeSubtype(TypeVariable target, AnnotatedTypeMirror supertype, Set<AnnotationMirror> hierarchies)
hierarchies
- a set of TOP annotationspublic void addPrimarySubtypes(TypeVariable target, QualifierHierarchy qualifierHierarchy, Set<AnnotationMirror> annos)
public void addTypeEqualities(TypeVariable target, AnnotatedTypeMirror type, Set<AnnotationMirror> hierarchies)
hierarchies
- a set of TOP annotations