T
- the type to compareE
- the type of Throwable declared@FunctionalInterface public interface CheckedComparator<T,E extends Throwable> extends CheckedToIntBiFunction<T,T,E>
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>,E extends Throwable> |
comparing(CheckedFunction<? super T,? extends U,? extends E> keyExtractor)
|
static <T,U,E extends Throwable> |
comparing(CheckedFunction<? super T,? extends U,? extends E> keyExtractor,
CheckedComparator<? super U,? extends E> keyComparator)
|
static <T,E extends Throwable> |
comparingDouble(CheckedToDoubleFunction<? super T,? extends E> keyExtractor)
|
static <T,E extends Throwable> |
comparingInt(CheckedToIntFunction<? super T,? extends E> keyExtractor)
|
static <T,E extends Throwable> |
comparingLong(CheckedToLongFunction<? super T,? extends E> keyExtractor)
|
default Comparator<T> |
reversed()
|
default CheckedComparator<T,E> |
thenComparing(CheckedComparator<? super T,? extends E> other)
|
default <U extends Comparable<? super U>> |
thenComparing(CheckedFunction<? super T,? extends U,E> keyExtractor)
|
default <U> CheckedComparator<T,E> |
thenComparing(CheckedFunction<? super T,? extends U,E> keyExtractor,
CheckedComparator<? super U,E> keyComparator)
|
default CheckedComparator<T,E> |
thenComparingDouble(CheckedToDoubleFunction<? super T,? extends E> keyExtractor)
|
default CheckedComparator<T,E> |
thenComparingInt(CheckedToIntFunction<? super T,? extends E> keyExtractor)
|
default CheckedComparator<T,E> |
thenComparingLong(CheckedToLongFunction<? super T,? extends E> keyExtractor)
|
default int applyAsInt(T t, T u) throws E extends Throwable
CheckedToIntBiFunction
applyAsInt
in interface CheckedToIntBiFunction<T,T,E extends Throwable>
t
- the first function argumentu
- the second function argumentE extends Throwable
int compare(T o1, T o2) throws E extends Throwable
o1
- first object to compare.o2
- second object to compare.Throwable
- any throwabledefault Comparator<T> reversed()
this
default CheckedComparator<T,E> thenComparing(CheckedComparator<? super T,? extends E> 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,E> thenComparing(CheckedFunction<? super T,? extends U,E> keyExtractor, CheckedComparator<? super U,E> 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,E> thenComparing(CheckedFunction<? super T,? extends U,E> keyExtractor)
U
- the type of the Comparable
sort keykeyExtractor
- function used to extract sort key.CheckedComparator
thenComparing(CheckedComparator)
default CheckedComparator<T,E> thenComparingInt(CheckedToIntFunction<? super T,? extends E> keyExtractor)
keyExtractor
- function used to extract primitive int
sort key.CheckedComparator
thenComparing(CheckedComparator)
default CheckedComparator<T,E> thenComparingLong(CheckedToLongFunction<? super T,? extends E> keyExtractor)
keyExtractor
- function used to extract primitive long
sort key.CheckedComparator
thenComparing(CheckedComparator)
default CheckedComparator<T,E> thenComparingDouble(CheckedToDoubleFunction<? super T,? extends E> keyExtractor)
keyExtractor
- function used to extract primitive double
sort key.CheckedComparator
thenComparing(CheckedComparator)
static <T,U,E extends Throwable> CheckedComparator<T,E> comparing(CheckedFunction<? super T,? extends U,? extends E> keyExtractor, CheckedComparator<? super U,? extends E> 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>,E extends Throwable> CheckedComparator<T,E> comparing(CheckedFunction<? super T,? extends U,? extends E> 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,E extends Throwable> CheckedComparator<T,E> comparingInt(CheckedToIntFunction<? super T,? extends E> 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,E extends Throwable> CheckedComparator<T,E> comparingLong(CheckedToLongFunction<? super T,? extends E> 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,E extends Throwable> CheckedComparator<T,E> comparingDouble(CheckedToDoubleFunction<? super T,? extends E> 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.