Class DirectedCycle


  • public class DirectedCycle
    extends java.lang.Object
    DirectedCycle Class
    • Constructor Summary

      Constructors 
      Constructor Description
      DirectedCycle​(DirectedGraph graph)
      DirectedCycle a constructor :fired when a cycle is found.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Stack<java.lang.Integer> getCycle()
      Return the directed cycle if isCyclic
      boolean hasCycle()
      Does the DirectedCycle have a directed cycle
      boolean isCyclic()
      isCyclic know of a graph is cyclic or not
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DirectedCycle

        public DirectedCycle​(DirectedGraph graph)
        DirectedCycle a constructor :fired when a cycle is found.
        Parameters:
        graph - the DirectedCycle
        Throws:
        CycleFoundException
    • Method Detail

      • hasCycle

        public boolean hasCycle()
        Does the DirectedCycle have a directed cycle
        Returns:
        true if the Graph has a directed cycle, false otherwise
      • isCyclic

        public boolean isCyclic()
        isCyclic know of a graph is cyclic or not
        Returns:
        boolean
      • getCycle

        public java.util.Stack<java.lang.Integer> getCycle()
        Return the directed cycle if isCyclic
        Returns:
        the directed cycle or null