Class SortWith<A>

  • Type Parameters:
    A - the input Iterable and output List element type
    All Implemented Interfaces:
    Fn1<java.util.Comparator<? super A>,​Fn1<java.lang.Iterable<A>,​java.util.List<A>>>, Fn2<java.util.Comparator<? super A>,​java.lang.Iterable<A>,​java.util.List<A>>, Applicative<Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<java.util.Comparator<? super A>,​?>>, Cartesian<java.util.Comparator<? super A>,​Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<?,​?>>, Cocartesian<java.util.Comparator<? super A>,​Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<?,​?>>, Contravariant<java.util.Comparator<? super A>,​Profunctor<?,​Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<?,​?>>>, Functor<Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<java.util.Comparator<? super A>,​?>>, Profunctor<java.util.Comparator<? super A>,​Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<?,​?>>, Monad<Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<java.util.Comparator<? super A>,​?>>, MonadReader<java.util.Comparator<? super A>,​Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<java.util.Comparator<? super A>,​?>>, MonadRec<Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<java.util.Comparator<? super A>,​?>>, MonadWriter<java.util.Comparator<? super A>,​Fn1<java.lang.Iterable<A>,​java.util.List<A>>,​Fn1<java.util.Comparator<? super A>,​?>>

    public final class SortWith<A>
    extends java.lang.Object
    implements Fn2<java.util.Comparator<? super A>,​java.lang.Iterable<A>,​java.util.List<A>>
    Given an Iterable and a Comparator over the Iterable element type, produce a sorted List of the original elements based on sorting applied by the Comparator. Note that this is both eager and monolithic.
    See Also:
    Sort, SortBy
    • Field Detail

      • INSTANCE

        private static final SortWith<?> INSTANCE
    • Constructor Detail

      • SortWith

        private SortWith()
    • Method Detail

      • checkedApply

        public java.util.List<A> checkedApply​(java.util.Comparator<? super A> comparator,
                                              java.lang.Iterable<A> as)
        Specified by:
        checkedApply in interface Fn2<java.util.Comparator<? super A>,​java.lang.Iterable<A>,​java.util.List<A>>
      • sortWith

        public static <A> SortWith<A> sortWith()
      • sortWith

        public static <A> Fn1<java.lang.Iterable<A>,​java.util.List<A>> sortWith​(java.util.Comparator<? super A> comparator)
      • sortWith

        public static <A> java.util.List<A> sortWith​(java.util.Comparator<? super A> comparator,
                                                     java.lang.Iterable<A> as)