Package org.opendaylight.yangtools.util
Class TopologicalSort
- java.lang.Object
-
- org.opendaylight.yangtools.util.TopologicalSort
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TopologicalSort.Edge
Interface for edges in graph that can be sorted topologically.static class
TopologicalSort.EdgeImpl
Basic Edge implementation.static interface
TopologicalSort.Node
Interface for nodes in graph that can be sorted topologically.static class
TopologicalSort.NodeImpl
Basic Node implementation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<TopologicalSort.Node>
sort(Set<TopologicalSort.Node> nodes)
Topological sort of dependent nodes in acyclic graphs.
-
-
-
Method Detail
-
sort
public static List<TopologicalSort.Node> sort(Set<TopologicalSort.Node> nodes)
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
-
-