A
- the value typeB
- the mapped comparison typepublic final class MaxBy<A,B extends Comparable<B>> extends Object implements SemigroupFactory<Fn1<? super A,? extends B>,A>
A
to some Comparable
type B
, produce a
Semigroup
over A
that chooses between two values x
and y
via the
following rules:
x
is strictly less than y
in terms of B
, return y
x
Modifier and Type | Method and Description |
---|---|
Semigroup<A> |
checkedApply(Fn1<? super A,? extends B> compareFn)
Invoke this function with the given argument, potentially throwing any
Throwable . |
static <A,B extends Comparable<B>> |
maxBy() |
static <A,B extends Comparable<B>> |
maxBy(Fn1<? super A,? extends B> compareFn) |
static <A,B extends Comparable<B>> |
maxBy(Fn1<? super A,? extends B> compareFn,
A x) |
static <A,B extends Comparable<B>> |
maxBy(Fn1<? super A,? extends B> compareFn,
A x,
A y) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, checkedApply
apply, apply, checkedApply, compose, contraMap, diMapL, discardR, flip, fn3, fn3, fn3, uncurry, widen
curried, curry, fn2, fromBiFunction, toBiFunction
public Semigroup<A> checkedApply(Fn1<? super A,? extends B> compareFn)
Fn2
Throwable
.checkedApply
in interface Fn1<Fn1<? super A,? extends B extends Comparable<B>>,Fn1<A,Fn1<A,A>>>
checkedApply
in interface Fn2<Fn1<? super A,? extends B extends Comparable<B>>,A,Fn1<A,A>>
checkedApply
in interface SemigroupFactory<Fn1<? super A,? extends B extends Comparable<B>>,A>
compareFn
- the argumentpublic static <A,B extends Comparable<B>> MaxBy<A,B> maxBy()
public static <A,B extends Comparable<B>> Semigroup<A> maxBy(Fn1<? super A,? extends B> compareFn)
public static <A,B extends Comparable<B>> Fn1<A,A> maxBy(Fn1<? super A,? extends B> compareFn, A x)
public static <A,B extends Comparable<B>> A maxBy(Fn1<? super A,? extends B> compareFn, A x, A y)