Interface TopologicalSort.TopologicalOrderPermutationIterator<T>

  • Type Parameters:
    T - type
    All Superinterfaces:
    Iterator<List<T>>
    Enclosing class:
    TopologicalSort

    public static interface TopologicalSort.TopologicalOrderPermutationIterator<T>
    extends Iterator<List<T>>
    An iterator extending Iterator providing the ability to skip a certain prefix.
    • Method Detail

      • skip

        void skip​(int level)
        Instructs the iterator to advance to the next possible ordering using the given zero-indexed level. Example 1: If the last returned ordering of the iterator it is (e0, e1, e2, e3) and it.skip(2) is called, the state of the iterator is advanced in a way that either reaches the end of iteration or the next item that is returned is (e0', e1', e3', e4') where the prefix (e1', e2', e3') is not equal to {code (e1, e2, e3)}. Example 2: If the last returned ordering of the iterator it is (e1, e2, e3, e4) and it.skip(1) is called, the state of the iterator is advanced in a way that either reaches the end of iteration or the next item that is returned is (e1', e2', e3', e4') where the prefix (e1', e2') is not equal to {code (e1, e2)}.
        Parameters:
        level - skip level