Class Dependencies
java.lang.Object
org.checkerframework.framework.util.typeinference8.types.Dependencies
A data structure to hold the dependencies between variables. Dependencies are defined in JLS section
18.4 and impact the order in which variables are resolved.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalculate and add transitive dependencies.Returns a non-modifiable view of the dependencies ofalpha.get(Collection<? extends Variable> variables) Returns the set of dependencies for all variables invariables.Returns a fresh, mutable set of the dependencies ofalpha.voidAddvalueas a dependency ofkey.voidputOrAddAll(Variable key, Collection<? extends Variable> values) Addvaluesas dependencies ofkey.
-
Constructor Details
-
Dependencies
public Dependencies()Creates Dependencies.
-
-
Method Details
-
putOrAdd
Addvalueas a dependency ofkey.- Parameters:
key- a key to addvalue- a value to add
-
putOrAddAll
Addvaluesas dependencies ofkey.- Parameters:
key- a key to addvalues- values to add
-
calculateTransitiveDependencies
public void calculateTransitiveDependencies()Calculate and add transitive dependencies.JLS 18.4 "An inference variable alpha depends on the resolution of an inference variable beta if there exists an inference variable gamma such that alpha depends on the resolution of gamma and gamma depends on the resolution of beta."
-
dependsOn
Returns a non-modifiable view of the dependencies ofalpha. The returned set is backed by the internal map; callers must not mutate it and must treat it as read-only.- Parameters:
alpha- a variable- Returns:
- a non-modifiable view of the dependencies of
alpha
-
get
Returns a fresh, mutable set of the dependencies ofalpha. Use this only when the caller needs to mutate the returned set; otherwise usedependsOn(Variable).- Parameters:
alpha- a variable- Returns:
- a fresh, mutable copy of the dependencies of
alpha
-
get
Returns the set of dependencies for all variables invariables. The returned set is freshly allocated and mutable.- Parameters:
variables- collection of variables- Returns:
- the set of dependencies for all variables in
variables
-