Class SortWith<A>
- java.lang.Object
-
- com.jnape.palatable.lambda.functions.builtin.fn2.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 anIterable
and aComparator
over theIterable
element type, produce a sortedList
of the original elements based on sorting applied by theComparator
. Note that this is both eager and monolithic.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SortWith()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<A>
checkedApply(java.util.Comparator<? super A> comparator, java.lang.Iterable<A> as)
static <A> SortWith<A>
sortWith()
static <A> Fn1<java.lang.Iterable<A>,java.util.List<A>>
sortWith(java.util.Comparator<? super A> comparator)
static <A> java.util.List<A>
sortWith(java.util.Comparator<? super A> comparator, java.lang.Iterable<A> as)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
-
-
-
-
Field Detail
-
INSTANCE
private static final SortWith<?> INSTANCE
-
-
Method Detail
-
checkedApply
public java.util.List<A> checkedApply(java.util.Comparator<? super A> comparator, java.lang.Iterable<A> as)
- Specified by:
checkedApply
in interfaceFn2<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)
-
-