Package de.hybris.bootstrap.util
Class RequirementSolver
- java.lang.Object
-
- de.hybris.bootstrap.util.RequirementSolver
-
public abstract class RequirementSolver extends java.lang.ObjectImplementation of a sort algorithm for computing the order of dependent objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends RequirementHolder>
java.util.List<T>solve(java.util.Collection<T> elements)Sorts the given list of requirements in a manner that honors the given relationships.static java.util.List<java.util.List<? extends RequirementHolder>>solveParallel(java.util.Collection<? extends RequirementHolder> elements)return a list of list's with tasks that contains either one RequirementHolder or multiple one's, if they can be processed together at a time (which means they have no dependencies between each other) This can be used for parallel computing..
-
-
-
Method Detail
-
solveParallel
public static java.util.List<java.util.List<? extends RequirementHolder>> solveParallel(java.util.Collection<? extends RequirementHolder> elements) throws RequirementSolverException
return a list of list's with tasks that contains either one RequirementHolder or multiple one's, if they can be processed together at a time (which means they have no dependencies between each other) This can be used for parallel computing..- Throws:
RequirementSolverException
-
solve
public static <T extends RequirementHolder> java.util.List<T> solve(java.util.Collection<T> elements) throws RequirementSolverException
Sorts the given list of requirements in a manner that honors the given relationships. That is, if project A references project B, then the resulting order will list B before A if possible. For graphs that do not contain cycles, the result is the same as a conventional topological sort.- Parameters:
elements- a list of RequirementHolders (e.g.:ExtensionInfo)- Returns:
- an object describing the resulting order
- Throws:
RequirementSolverException- if there are cycles detected.
-
-