Class CyclePresentException

  • All Implemented Interfaces:
    java.io.Serializable

    public final class CyclePresentException
    extends java.lang.IllegalArgumentException
    An exception thrown for graphs with cycles as an argument for topological sort.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<java.util.Set<?>> cycles  
    • Constructor Summary

      Constructors 
      Constructor Description
      CyclePresentException​(java.util.Set<java.util.Set<?>> cycles)
      Creates the exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> java.util.Set<java.util.Set<T>> getCycles()
      Accesses the cycles present in the sorted graph.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • cycles

        private final java.util.Set<java.util.Set<?>> cycles
    • Constructor Detail

      • CyclePresentException

        CyclePresentException​(java.util.Set<java.util.Set<?>> cycles)
        Creates the exception.
        Parameters:
        cycles - the cycles present
    • Method Detail

      • getCycles

        public <T> java.util.Set<java.util.Set<T>> getCycles()
        Accesses the cycles present in the sorted graph.

        Each element in the outer set represents a cycle; each cycle, or the inner set, forms a strongly connected component with two or more elements.

        Type Parameters:
        T - the type of node sorted
        Returns:
        the cycles identified