Package com.evolveum.midpoint.util
Class DependencyGraph<X>
java.lang.Object
com.evolveum.midpoint.util.DependencyGraph<X>
Represents the dependencies between items.
Provides
getSortedItems() and getTopologicalSort() methods to sort the items topologically.
Can be created right from the dependency map (ofMap(Map)) or from individual items (ofItems(Collection)).
The dependencies themselves must reference only known items.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDependencyGraph.Item<I extends DependencyGraph.Item<I>>An item that can tell us about its dependencies.static classRepresents a topological sort of items. -
Method Summary
Modifier and TypeMethodDescriptionReturns the items sorted topologically: if A is before B, then A does not depend on B, or throws an exception if no such ordering exists.@NotNull DependencyGraph.TopologicalSort<X>Returns items topologically sorted (as much as possible).static <I extends DependencyGraph.Item<I>>
DependencyGraph<I>ofItems(@NotNull Collection<I> items) Creates the dependency graph from items that can tell us about their dependencies.static <X> DependencyGraph<X>ofMap(Map<X, Collection<X>> dependencyMap) Creates the dependency graph from the given dependency map.
-
Method Details
-
ofMap
Creates the dependency graph from the given dependency map. -
ofItems
public static <I extends DependencyGraph.Item<I>> DependencyGraph<I> ofItems(@NotNull @NotNull Collection<I> items) Creates the dependency graph from items that can tell us about their dependencies. -
getSortedItems
Returns the items sorted topologically: if A is before B, then A does not depend on B, or throws an exception if no such ordering exists. -
getTopologicalSort
Returns items topologically sorted (as much as possible).
-