public final class Es6SortedDependencies<INPUT extends DependencyInfo> extends java.lang.Object implements SortedDependencies<INPUT>
Orders such that each input always comes after its dependencies. Circular references are allowed by emitting the current input in the moment before a loop would complete.
The resulting order is not the same as the user-provided order but is influenced by it since it may take more than one graph traversal to account for all provided inputs and the graph traversals start with the first user provided input and continue from there.
Also exposes other information about the inputs, like which inputs do not provide symbols.
SortedDependencies.MissingProvideException
Constructor and Description |
---|
Es6SortedDependencies(java.util.List<INPUT> userOrderedInputs) |
Modifier and Type | Method and Description |
---|---|
INPUT |
getInputProviding(java.lang.String symbolName)
Return the input that gives us the given symbol.
|
com.google.common.collect.ImmutableList<INPUT> |
getInputsWithoutProvides() |
java.util.List<INPUT> |
getSortedList() |
com.google.common.collect.ImmutableList<INPUT> |
getSortedStrongDependenciesOf(java.util.List<INPUT> roots)
Gets all the strong dependencies of the given roots.
|
java.util.List<INPUT> |
getSortedWeakDependenciesOf(java.util.List<INPUT> rootInputs)
Gets all the weak dependencies of the given roots.
|
com.google.common.collect.ImmutableList<INPUT> |
getStrongDependenciesOf(java.util.List<INPUT> rootInputs,
boolean sorted)
Gets all the strong dependencies of the given roots.
|
INPUT |
maybeGetInputProviding(java.lang.String symbol)
Return the input that gives us the given symbol, or null.
|
public Es6SortedDependencies(java.util.List<INPUT> userOrderedInputs)
public com.google.common.collect.ImmutableList<INPUT> getStrongDependenciesOf(java.util.List<INPUT> rootInputs, boolean sorted)
SortedDependencies
getStrongDependenciesOf
in interface SortedDependencies<INPUT extends DependencyInfo>
sorted
- If true, get them in topologically sorted order. If false, get them in the
original order they were passed to the compiler.public INPUT getInputProviding(java.lang.String symbolName) throws SortedDependencies.MissingProvideException
SortedDependencies
getInputProviding
in interface SortedDependencies<INPUT extends DependencyInfo>
SortedDependencies.MissingProvideException
- An exception if there is no
input for this symbol.public com.google.common.collect.ImmutableList<INPUT> getInputsWithoutProvides()
getInputsWithoutProvides
in interface SortedDependencies<INPUT extends DependencyInfo>
public com.google.common.collect.ImmutableList<INPUT> getSortedStrongDependenciesOf(java.util.List<INPUT> roots)
SortedDependencies
getSortedStrongDependenciesOf
in interface SortedDependencies<INPUT extends DependencyInfo>
public java.util.List<INPUT> getSortedWeakDependenciesOf(java.util.List<INPUT> rootInputs)
SortedDependencies
The weak dependencies are those that are only reachable via type requires from the roots. Note that if a root weakly requires another input, then all of its transitive dependencies (strong or weak) that are not strongly reachable from the roots will be included. e.g. if A weakly requires B, and B strongly requires C, and A is the sole root, then this will return B and C. However, if we add D as a root, and D strongly requires C, then this will only return B.
Root inputs will never be in the returned list as they are all considered strong.
getSortedWeakDependenciesOf
in interface SortedDependencies<INPUT extends DependencyInfo>
public java.util.List<INPUT> getSortedList()
getSortedList
in interface SortedDependencies<INPUT extends DependencyInfo>
public INPUT maybeGetInputProviding(java.lang.String symbol)
SortedDependencies
maybeGetInputProviding
in interface SortedDependencies<INPUT extends DependencyInfo>
Copyright © 2009-2019 Google. All Rights Reserved.