T
- the type to compare@FunctionalInterface public interface CheckedComparator<T> extends CheckedToIntBiFunction<T,T>
Comparator
, also extends CheckedToIntBiFunction
Comparator
Modifier and Type | Method and Description |
---|---|
default int |
applyAsInt(T t,
T u)
Applies this function to the given arguments.
|
int |
compare(T o1,
T o2)
|
static <T,U extends Comparable<? super U>> |
comparing(CheckedFunction<? super T,? extends U> keyExtractor)
|
static <T,U> CheckedComparator<T> |
comparing(CheckedFunction<? super T,? extends U> keyExtractor,
CheckedComparator<? super U> keyComparator)
|
static <T> CheckedComparator<T> |
comparingDouble(CheckedToDoubleFunction<? super T> keyExtractor)
|
static <T> CheckedComparator<T> |
comparingInt(CheckedToIntFunction<? super T> keyExtractor)
|
static <T> CheckedComparator<T> |
comparingLong(CheckedToLongFunction<? super T> keyExtractor)
|
default Comparator<T> |
reversed()
|
default CheckedComparator<T> |
thenComparing(CheckedComparator<? super T> other)
|
default <U extends Comparable<? super U>> |
thenComparing(CheckedFunction<? super T,? extends U> keyExtractor)
|
default <U> CheckedComparator<T> |
thenComparing(CheckedFunction<? super T,? extends U> keyExtractor,
CheckedComparator<? super U> keyComparator)
|
default CheckedComparator<T> |
thenComparingDouble(CheckedToDoubleFunction<? super T> keyExtractor)
|
default CheckedComparator<T> |
thenComparingInt(CheckedToIntFunction<? super T> keyExtractor)
|
default CheckedComparator<T> |
thenComparingLong(CheckedToLongFunction<? super T> keyExtractor)
|
default int applyAsInt(T t, T u) throws Throwable
CheckedToIntBiFunction
applyAsInt
in interface CheckedToIntBiFunction<T,T>
t
- the first function argumentu
- the second function argumentThrowable
- Any throwableint compare(T o1, T o2) throws Throwable
o1
- first object to compare.o2
- second object to compare.Throwable
- any throwabledefault Comparator<T> reversed()
this
default CheckedComparator<T> thenComparing(@Nonnull CheckedComparator<? super T> other)
other
- the next comparator to be chained (IFF this.compare(a, b)
returns zero)CheckedComparator
NullPointerException
- if other
is null
default <U> CheckedComparator<T> thenComparing(CheckedFunction<? super T,? extends U> keyExtractor, CheckedComparator<? super U> keyComparator)
U
- the type of the sort keykeyExtractor
- function used to extract sort keykeyComparator
- comparator used to compare extracted keyCheckedComparator
thenComparing(CheckedComparator)
default <U extends Comparable<? super U>> CheckedComparator<T> thenComparing(CheckedFunction<? super T,? extends U> keyExtractor)
U
- the type of the Comparable
sort keykeyExtractor
- function used to extract sort key.CheckedComparator
thenComparing(CheckedComparator)
default CheckedComparator<T> thenComparingInt(CheckedToIntFunction<? super T> keyExtractor)
keyExtractor
- function used to extract primitive int
sort key.CheckedComparator
thenComparing(CheckedComparator)
default CheckedComparator<T> thenComparingLong(CheckedToLongFunction<? super T> keyExtractor)
keyExtractor
- function used to extract primitive long
sort key.CheckedComparator
thenComparing(CheckedComparator)
default CheckedComparator<T> thenComparingDouble(CheckedToDoubleFunction<? super T> keyExtractor)
keyExtractor
- function used to extract primitive double
sort key.CheckedComparator
thenComparing(CheckedComparator)
@ParametersAreNonnullByDefault static <T,U> CheckedComparator<T> comparing(CheckedFunction<? super T,? extends U> keyExtractor, CheckedComparator<? super U> keyComparator)
T
- the type of element to be comparedU
- the type of the sort keykeyExtractor
- function used to extract sort key.keyComparator
- comparator used to compare extracted key.CheckedComparator
.NullPointerException
- if either argument is null
.static <T,U extends Comparable<? super U>> CheckedComparator<T> comparing(@Nonnull CheckedFunction<? super T,? extends U> keyExtractor)
T
- the type of element to be compared.U
- the type of the sort key.keyExtractor
- the function used to extract the sort key.NullPointerException
- if the argument is null
.static <T> CheckedComparator<T> comparingInt(@Nonnull CheckedToIntFunction<? super T> keyExtractor)
T
- the type of element to be compared.keyExtractor
- the function used to extract primitive int
sort key.NullPointerException
- if the argument is null
.comparing(CheckedFunction)
static <T> CheckedComparator<T> comparingLong(@Nonnull CheckedToLongFunction<? super T> keyExtractor)
T
- the type of element to be compared.keyExtractor
- the function used to extract primitive long
sort key.NullPointerException
- if the argument is null
.comparing(CheckedFunction)
static <T> CheckedComparator<T> comparingDouble(@Nonnull CheckedToDoubleFunction<? super T> keyExtractor)
T
- the type of element to be compared.keyExtractor
- the function used to extract primitive double
sort key.NullPointerException
- if the argument is null
.comparing(CheckedFunction)
Copyright © 2016–2018 earcam. All rights reserved.