use of org.checkerframework.framework.util.AnnotationMirrorSet in project checker-framework by typetools.
the class ConstraintMap method addTargetSubtype.
/**
* Add a constraint indicating that target is a subtype of supertype in the given qualifier
* hierarchies.
*
* @param hierarchies a set of TOP annotations
*/
public void addTargetSubtype(final TypeVariable target, final TypeVariable supertype, AnnotationMirrorSet hierarchies) {
final Subtypes subtypes = targetToRecords.get(target).subtypes;
final AnnotationMirrorSet subtypesTops = subtypes.targets.computeIfAbsent(supertype, __ -> new AnnotationMirrorSet());
subtypesTops.addAll(hierarchies);
}
use of org.checkerframework.framework.util.AnnotationMirrorSet in project checker-framework by typetools.
the class ConstraintMap method addTargetEquality.
/**
* Add a constraint indicating that the equivalent is equal to target in the given qualifier
* hierarchies.
*/
public void addTargetEquality(final TypeVariable target, final TypeVariable equivalent, AnnotationMirrorSet hierarchies) {
final Equalities equalities = targetToRecords.get(target).equalities;
final AnnotationMirrorSet equivalentTops = equalities.targets.computeIfAbsent(equivalent, __ -> new AnnotationMirrorSet());
equivalentTops.addAll(hierarchies);
}
use of org.checkerframework.framework.util.AnnotationMirrorSet 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.computeIfAbsent(subtype, __ -> new AnnotationMirrorSet());
supertypeTops.addAll(hierarchies);
}
use of org.checkerframework.framework.util.AnnotationMirrorSet in project checker-framework by typetools.
the class ConstraintMap method addTypeSubtype.
/**
* Add a constraint indicating that target is a subtype of supertype in the given qualifier
* hierarchies.
*
* @param hierarchies a set of TOP annotations
*/
public void addTypeSubtype(final TypeVariable target, final AnnotatedTypeMirror supertype, AnnotationMirrorSet hierarchies) {
final Subtypes subtypes = targetToRecords.get(target).subtypes;
final AnnotationMirrorSet subtypesTops = subtypes.types.computeIfAbsent(supertype, __ -> new AnnotationMirrorSet());
subtypesTops.addAll(hierarchies);
}
use of org.checkerframework.framework.util.AnnotationMirrorSet in project checker-framework by typetools.
the class ConstraintMap method addPrimarySubtypes.
/**
* Add a constraint indicating that target's primary annotations are subtypes of the given
* annotations.
*/
public void addPrimarySubtypes(final TypeVariable target, QualifierHierarchy qualifierHierarchy, final AnnotationMirrorSet annos) {
final Subtypes subtypes = targetToRecords.get(target).subtypes;
for (final AnnotationMirror anno : annos) {
final AnnotationMirror top = qualifierHierarchy.getTopAnnotation(anno);
AnnotationMirrorSet entries = subtypes.primaries.computeIfAbsent(top, __ -> new AnnotationMirrorSet());
entries.add(anno);
}
}
Aggregations