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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Calculate and add transitive dependencies.Returns the set of dependencies for all variables invariables
.Returns the set of dependencies ofalpha
.void
Addvalue
as a dependency ofkey
.void
putOrAddAll
(Variable key, Collection<? extends Variable> values) Addvalues
as dependencies ofkey
.
-
Constructor Details
-
Dependencies
public Dependencies()Creates Dependencies.
-
-
Method Details
-
putOrAdd
Addvalue
as a dependency ofkey
.- Parameters:
key
- a key to addvalue
- a value to add
-
putOrAddAll
Addvalues
as 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."
-
get
Returns the set of dependencies ofalpha
.- Parameters:
alpha
- a variable- Returns:
- the set of dependencies of
alpha
-
get
Returns the set of dependencies for all variables invariables
.- Parameters:
variables
- list of variables- Returns:
- the set of dependencies for all variables in
variables
-