T - the type of the element to be comparedpublic abstract static class Osgl.Comparator<T> extends Osgl.F2<T,T,Integer> implements Comparator<T>, Serializable
| Constructor and Description |
|---|
Comparator() |
| Modifier and Type | Method and Description |
|---|---|
Integer |
apply(T p1,
T p2)
Apply the two params to the function
|
Osgl.Comparator<T> |
reversed()
See Java 8 doc
|
Osgl.Comparator<T> |
thenComparing(Comparator<? super T> other)
See Java 8 doc
|
<U extends Comparable<? super U>> |
thenComparing(Osgl.Function<? super T,? extends U> keyExtractor)
See Java 8 doc
|
<U extends Comparable<? super U>> |
thenComparing(Osgl.Function<? super T,? extends U> keyExtractor,
Comparator<? super U> keyComparator)
See Java 8 doc
|
andThen, andThen, applyOrElse, curry, curry, lift, orElsebreakOutclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reverseOrder, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic Integer apply(T p1, T p2) throws NotAppliedException, Osgl.Break
Osgl.Func2In case implementing a partial function, it can throw out an
NotAppliedException if the function is not defined for
the given parameter(s)
apply in interface Osgl.Func2<T,T,Integer>p1 - the first argument of type P1p2 - the second argument of type P2NotAppliedException - if the function doesn't apply to the parameter(s)Osgl.Break - to short cut collecting operations (fold/reduce) on an containerpublic Osgl.Comparator<T> reversed()
reversed in interface Comparator<T>public Osgl.Comparator<T> thenComparing(Comparator<? super T> other)
thenComparing in interface Comparator<T>public <U extends Comparable<? super U>> Osgl.Comparator<T> thenComparing(Osgl.Function<? super T,? extends U> keyExtractor, Comparator<? super U> keyComparator)
U - the generic type of the keykeyExtractor - The function to extract the key for comparisonkeyComparator - The function to compare the extracted keyU from element of type T
and run keyComparator to compare the two keyspublic <U extends Comparable<? super U>> Osgl.Comparator<T> thenComparing(Osgl.Function<? super T,? extends U> keyExtractor)
U - the key typekeyExtractor - the function that extract key of type U from instance of type TCopyright © 2017. All Rights Reserved.