Class CyclePresentException

All Implemented Interfaces:
Serializable

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

    • cycles

      private final Set<Set<?>> cycles
  • Constructor Details

    • CyclePresentException

      CyclePresentException(Set<Set<?>> cycles)
      Creates the exception.
      Parameters:
      cycles - the cycles present
  • Method Details

    • getCycles

      public <T> Set<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