Class Sorted<T>

  • Type Parameters:
    T - Element type
    All Implemented Interfaces:
    Iterable<T>

    public final class Sorted<T>
    extends IterableEnvelope<T>
    Sorted iterable.

    There is no thread-safety guarantee.

    Since:
    0.7
    • Constructor Detail

      • Sorted

        @SafeVarargs
        public Sorted​(T... src)
        Ctor.
        Parameters:
        src - The underlying iterable
      • Sorted

        public Sorted​(Iterable<? extends T> src)
        Ctor.

        If you're using this ctor you must be sure that type T implements Comparable interface. Otherwise, there will be a type casting exception in runtime.

        Parameters:
        src - The underlying iterable
      • Sorted

        @SafeVarargs
        public Sorted​(Comparator<? super T> cmp,
                      T... src)
        Ctor.
        Parameters:
        cmp - The comparator
        src - The underlying iterable
      • Sorted

        public Sorted​(Comparator<? super T> cmp,
                      Iterable<? extends T> src)
        Ctor.
        Parameters:
        cmp - The comparator
        src - The underlying iterable