Class InferenceResult
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>
Represents the result from inferring type arguments. InferenceResult is a map from: target type
variable to (inferred type or target).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetRemainingTargets
(Set<TypeVariable> allTargets, boolean inferredTypesOnly) Returns the set of targets that still don't have an inferred argument.boolean
isComplete
(Set<TypeVariable> targets) Returns true if we have inferred a concrete type for all targets.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.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.void
If we had a set of inferred results, (e.g.toAtmMap()
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
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
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
-
mergeSubordinate
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.
-