Class CyclicGraphDetector<N>


  • public abstract class CyclicGraphDetector<N>
    extends java.lang.Object
    Traverses a directed graph and if it contains any cycle, throw an exception.
    Author:
    Kohsuke Kawaguchi
    • Method Summary

      Modifier and Type Method Description
      protected abstract java.lang.Iterable<? extends N> getEdges​(N n)
      List up edges from the given node (by listing nodes that those edges point to.)
      java.util.List<N> getSorted()
      Returns all the nodes in the topologically sorted order.
      protected void reactOnCycle​(N q, java.util.List<N> cycle)
      React on detected cycles - default implementation throws an exception.
      void run​(java.lang.Iterable<? extends N> allNodes)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait