Package hudson.util
Class CyclicGraphDetector<N>
java.lang.Object
hudson.util.CyclicGraphDetector<N>
Traverses a directed graph and if it contains any cycle, throw an exception.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList up edges from the given node (by listing nodes that those edges point to.)Returns all the nodes in the topologically sorted order.protected voidreactOnCycle(N q, List<N> cycle) React on detected cycles - default implementation throws an exception.void
-
Constructor Details
-
CyclicGraphDetector
public CyclicGraphDetector()
-
-
Method Details
-
run
-
getSorted
Returns all the nodes in the topologically sorted order. That is, if there's an edge a → b, b always come earlier than a. -
getEdges
List up edges from the given node (by listing nodes that those edges point to.)- Returns:
- Never null.
-
reactOnCycle
React on detected cycles - default implementation throws an exception.
-