Class SortedDependencies<INPUT extends DependencyInfo>
- java.lang.Object
-
- com.google.javascript.jscomp.deps.SortedDependencies<INPUT>
-
public class SortedDependencies<INPUT extends DependencyInfo> extends java.lang.Object
A sorted list of inputs with dependency information. Uses a stable topological sort to make sure that an input always comes after its dependencies. Also exposes other information about the inputs, like which inputs do not provide symbols.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SortedDependencies.CircularDependencyException
static class
SortedDependencies.MissingProvideException
-
Constructor Summary
Constructors Constructor Description SortedDependencies(java.util.List<INPUT> inputs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<INPUT>
getDependenciesOf(java.util.List<INPUT> roots, boolean sorted)
Gets all the dependencies of the given roots.INPUT
getInputProviding(java.lang.String symbol)
Return the input that gives us the given symbol.java.util.List<INPUT>
getInputsWithoutProvides()
java.util.List<INPUT>
getSortedDependenciesOf(java.util.List<INPUT> roots)
Gets all the dependencies of the given roots.java.util.List<INPUT>
getSortedList()
INPUT
maybeGetInputProviding(java.lang.String symbol)
Return the input that gives us the given symbol, or null.
-
-
-
Constructor Detail
-
SortedDependencies
public SortedDependencies(java.util.List<INPUT> inputs) throws SortedDependencies.CircularDependencyException
-
-
Method Detail
-
getInputProviding
public INPUT getInputProviding(java.lang.String symbol) throws SortedDependencies.MissingProvideException
Return the input that gives us the given symbol.- Throws:
SortedDependencies.MissingProvideException
- An exception if there is no input for this symbol.
-
maybeGetInputProviding
public INPUT maybeGetInputProviding(java.lang.String symbol)
Return the input that gives us the given symbol, or null.
-
getSortedList
public java.util.List<INPUT> getSortedList()
-
getSortedDependenciesOf
public java.util.List<INPUT> getSortedDependenciesOf(java.util.List<INPUT> roots)
Gets all the dependencies of the given roots. The inputs must be returned in a stable order. In other words, if A comes before B, and A does not transitively depend on B, then A must also come before B in the returned list.
-
getDependenciesOf
public java.util.List<INPUT> getDependenciesOf(java.util.List<INPUT> roots, boolean sorted)
Gets all the dependencies of the given roots. The inputs must be returned in a stable order. In other words, if A comes before B, and A does not transitively depend on B, then A must also come before B in the returned list.- Parameters:
sorted
- If true, get them in topologically sorted order. If false, get them in the original order they were passed to the compiler.
-
getInputsWithoutProvides
public java.util.List<INPUT> getInputsWithoutProvides()
-
-