Package org.opendaylight.yangtools.util
Class TopologicalSort
java.lang.Object
org.opendaylight.yangtools.util.TopologicalSort
Utility class that provides topological sort.
Note this class is non-public to allow for API transition.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface for edges in graph that can be sorted topologically.static class
Basic Edge implementation.static interface
Interface for nodes in graph that can be sorted topologically.static class
Basic Node implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic List
<TopologicalSort.Node> sort
(Set<TopologicalSort.Node> nodes) Topological sort of dependent nodes in acyclic graphs.
-
Method Details
-
sort
Topological sort of dependent nodes in acyclic graphs.- Parameters:
nodes
- graph nodes- Returns:
- Sorted
List
ofTopologicalSort.Node
s. Order: Nodes with no dependencies starting. - Throws:
IllegalStateException
- when cycle is present in the graph
-