java.lang.Object
org.checkerframework.framework.util.typeinference8.constraint.QualifierTyping
All Implemented Interfaces:
Constraint, ReductionResult

public class QualifierTyping extends Object implements Constraint
Represents a constraint between two AbstractType. One of:
  • Constructor Details

    • QualifierTyping

      public QualifierTyping(AbstractQualifier Q, AbstractQualifier R, Constraint.Kind kind)
      Creates a qualifier typing constraint.
      Parameters:
      Q - the qualifier on the left-hand side of the constraint
      R - the qualifier on the right-hand side of the constraint
      kind - the kind of qualifier constraint
  • Method Details

    • addQualifierConstraints

      public static void addQualifierConstraints(ConstraintSet constraintSet, Set<? extends AbstractQualifier> lhs, Set<? extends AbstractQualifier> rhs, Constraint.Kind kind)
      For each qualifier in lhs and each qualifier in rhs that are in the same hierarchy, adds to constraintSet a QualifierTyping constraint of kind kind between them. Two equal qualifiers are skipped, because a constraint between them reduces to true.
      Parameters:
      constraintSet - the constraint set to add the constraints to
      lhs - the qualifiers on the left-hand side of the new constraints
      rhs - the qualifiers on the right-hand side of the new constraints
      kind - the kind of the new constraints
    • getKind

      public Constraint.Kind getKind()
      Description copied from interface: Constraint
      Returns the kind of constraint.
      Specified by:
      getKind in interface Constraint
      Returns:
      the kind of constraint
    • reduce

      public ReductionResult reduce(Java8InferenceContext context)
      Description copied from interface: Constraint
      Reduce this constraint; what this means depends on the kind of constraint. Reduction can produce new bounds and/or new constraints.

      Reduction is documented in JLS section 18.2

      Specified by:
      reduce in interface Constraint
      Parameters:
      context - Java8InferenceContext
      Returns:
      the result of reducing this constraint
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object