java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<TypeVariable,InferredValue>
org.checkerframework.framework.util.typeinference.solver.InferenceResult
All Implemented Interfaces:
Serializable, Cloneable, Map<TypeVariable,InferredValue>

public class InferenceResult extends LinkedHashMap<TypeVariable,InferredValue>
Represents the result from inferring type arguments. InferenceResult is a map from: target type variable to (inferred type or target).
See Also:
  • Constructor Details

    • InferenceResult

      public InferenceResult()
  • Method Details

    • getRemainingTargets

      public Set<TypeVariable> getRemainingTargets(Set<TypeVariable> allTargets, boolean inferredTypesOnly)
      Returns the set of targets that still don't have an inferred argument.
      Returns:
      the set of targets that still don't have an inferred argument
    • isComplete

      public boolean isComplete(Set<TypeVariable> targets)
      Returns true if we have inferred a concrete type for all targets.
      Parameters:
      targets - type variables to check
      Returns:
      true if we have inferred a concrete type for all targets
    • resolveChainedTargets

      public void resolveChainedTargets()
      If we had a set of inferred results, (e.g. T1 = T2, T2 = T3, T3 = String) propagate any results we have (the above constraints become T1 = String, T2 = String, T3 = String)
    • toAtmMap

      public Map<TypeVariable,AnnotatedTypeMirror> toAtmMap()
    • mergeSubordinate

      public void mergeSubordinate(InferenceResult subordinate)
      Merges values in subordinate into this result, keeping the results form any type arguments that were already contained by this InferenceResult.
      Parameters:
      subordinate - a result which we wish to merge into this result
    • mergeTarget

      protected @Nullable InferredValue.InferredType mergeTarget(TypeVariable target, InferenceResult subordinate)
      Performs a merge for a specific target, we keep only results that lead to a concrete type.