java.lang.Object
org.checkerframework.framework.util.typeinference8.types.Dependencies

public class Dependencies extends Object
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 Details

    • Dependencies

      public Dependencies()
      Creates Dependencies.
  • Method Details

    • putOrAdd

      public void putOrAdd(Variable key, Variable value)
      Add value as a dependency of key.
      Parameters:
      key - a key to add
      value - a value to add
    • putOrAddAll

      public void putOrAddAll(Variable key, Collection<? extends Variable> values)
      Add values as dependencies of key.
      Parameters:
      key - a key to add
      values - 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

      public Set<Variable> get(Variable alpha)
      Returns the set of dependencies of alpha.
      Parameters:
      alpha - a variable
      Returns:
      the set of dependencies of alpha
    • get

      public Set<Variable> get(List<Variable> variables)
      Returns the set of dependencies for all variables in variables.
      Parameters:
      variables - list of variables
      Returns:
      the set of dependencies for all variables in variables