use of org.checkerframework.framework.util.typeinference.solver.TargetConstraints.Supertypes in project checker-framework by typetools.
the class ConstraintMap method addTypeSupertype.
/**
* Add a constraint indicating that target is a supertype of subtype in the given qualifier
* hierarchies
*
* @param hierarchies a set of TOP annotations
*/
public void addTypeSupertype(final TypeVariable target, final AnnotatedTypeMirror subtype, AnnotationMirrorSet hierarchies) {
final Supertypes supertypes = targetToRecords.get(target).supertypes;
final AnnotationMirrorSet supertypeTops = supertypes.types.get(subtype);
if (supertypeTops == null) {
supertypes.types.put(subtype, new AnnotationMirrorSet(hierarchies));
} else {
supertypeTops.addAll(hierarchies);
}
}
use of org.checkerframework.framework.util.typeinference.solver.TargetConstraints.Supertypes in project checker-framework by typetools.
the class ConstraintMap method addTargetSupertype.
/**
* Add a constraint indicating that target is a supertype of subtype in the given qualifier
* hierarchies
*
* @param hierarchies a set of TOP annotations
*/
public void addTargetSupertype(final TypeVariable target, final TypeVariable subtype, AnnotationMirrorSet hierarchies) {
final Supertypes supertypes = targetToRecords.get(target).supertypes;
final AnnotationMirrorSet supertypeTops = supertypes.targets.get(subtype);
if (supertypeTops == null) {
supertypes.targets.put(subtype, new AnnotationMirrorSet(hierarchies));
} else {
supertypeTops.addAll(hierarchies);
}
}
use of org.checkerframework.framework.util.typeinference.solver.TargetConstraints.Supertypes in project checker-framework by typetools.
the class ConstraintMap method addPrimarySupertype.
/**
* Add a constraint indicating that target's primary annotations are subtypes of the given
* annotations
*/
public void addPrimarySupertype(final TypeVariable target, QualifierHierarchy qualifierHierarchy, final AnnotationMirrorSet annos) {
final Supertypes supertypes = targetToRecords.get(target).supertypes;
for (final AnnotationMirror anno : annos) {
final AnnotationMirror top = qualifierHierarchy.getTopAnnotation(anno);
AnnotationMirrorSet entries = supertypes.primaries.get(top);
if (entries == null) {
entries = new AnnotationMirrorSet();
supertypes.primaries.put(top, entries);
}
entries.add(anno);
}
}
Aggregations