Package com.hazelcast.function
Interface ComparatorEx<T>
- Type Parameters:
T
- the type of objects that may be compared by this comparator
- All Superinterfaces:
Comparator<T>
,Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Serializable
variant of java.util.Comparator
which declares checked exception.- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
int
Exception-declaring version ofComparator.compare(T, T)
.static <T,
U extends Comparable<? super U>>
ComparatorEx<T>comparing
(FunctionEx<? super T, ? extends U> toKeyFn) Serializable
variant ofjava.util.Comparator#comparing(Function)
.static <T,
U> ComparatorEx<T> comparing
(FunctionEx<? super T, ? extends U> toKeyFn, ComparatorEx<? super U> keyComparator) Serializable
variant ofjava.util.Comparator#comparing(Function, Comparator)
.static <T,
U extends Comparable<? super U>>
ComparatorEx<T>Serializable
variant ofjava.util.Comparator#comparing(Function)
.static <T,
U> ComparatorEx<T> comparing
(Function<? super T, ? extends U> toKeyFn, Comparator<? super U> keyComparator) Serializable
variant ofjava.util.Comparator#comparing(Function, Comparator)
.static <T> ComparatorEx<T>
comparingDouble
(ToDoubleFunctionEx<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#comparingDouble(ToDoubleFunction)
.static <T> ComparatorEx<T>
comparingDouble
(ToDoubleFunction<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#comparingDouble(ToDoubleFunction)
.static <T> ComparatorEx<T>
comparingInt
(ToIntFunctionEx<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#comparingInt(ToIntFunction)
.static <T> ComparatorEx<T>
comparingInt
(ToIntFunction<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#comparingInt(ToIntFunction)
.static <T> ComparatorEx<T>
comparingLong
(ToLongFunctionEx<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#comparingLong(ToLongFunction)
.static <T> ComparatorEx<T>
comparingLong
(ToLongFunction<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#comparingLong(ToLongFunction)
.static <T extends Comparable<? super T>>
ComparatorEx<T>Serializable
variant ofjava.util.Comparator#naturalOrder()
.static <T> ComparatorEx<T>
nullsFirst
(ComparatorEx<? super T> comparator) Serializable
variant ofjava.util.Comparator#nullsFirst(Comparator)
.static <T> ComparatorEx<T>
nullsFirst
(Comparator<? super T> comparator) Serializable
variant ofjava.util.Comparator#nullsFirst(Comparator)
.static <T> ComparatorEx<T>
nullsLast
(ComparatorEx<? super T> comparator) Serializable
variant ofjava.util.Comparator#nullsLast(Comparator)
.static <T> ComparatorEx<T>
nullsLast
(Comparator<? super T> comparator) Serializable
variant ofjava.util.Comparator#nullsLast(Comparator)
.default ComparatorEx<T>
reversed()
Serializable
variant ofjava.util.Comparator#reversed()
static <T extends Comparable<? super T>>
ComparatorEx<T>Serializable
variant ofjava.util.Comparator#reverseOrder()
.default ComparatorEx<T>
thenComparing
(ComparatorEx<? super T> other) Serializable
variant ofjava.util.Comparator#thenComparing(Comparator)
.default <U extends Comparable<? super U>>
ComparatorEx<T>thenComparing
(FunctionEx<? super T, ? extends U> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparing(Function)
.default <U> ComparatorEx<T>
thenComparing
(FunctionEx<? super T, ? extends U> toKeyFn, ComparatorEx<? super U> keyComparator) Serializable
variant ofjava.util.Comparator#thenComparing(Function, Comparator)
.default ComparatorEx<T>
thenComparing
(Comparator<? super T> other) Serializable
variant ofjava.util.Comparator#thenComparing(Comparator)
.default <U extends Comparable<? super U>>
ComparatorEx<T>thenComparing
(Function<? super T, ? extends U> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparing(Function)
.default <U> ComparatorEx<T>
thenComparing
(Function<? super T, ? extends U> toKeyFn, Comparator<? super U> keyComparator) Serializable
variant ofjava.util.Comparator#thenComparing(Function, Comparator)
.default ComparatorEx<T>
thenComparingDouble
(ToDoubleFunctionEx<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparingDouble(ToDoubleFunction)
.default ComparatorEx<T>
thenComparingDouble
(ToDoubleFunction<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparingDouble(ToDoubleFunction)
.default ComparatorEx<T>
thenComparingInt
(ToIntFunctionEx<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparingInt(ToIntFunction)
.default ComparatorEx<T>
thenComparingInt
(ToIntFunction<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparingInt(ToIntFunction)
.default ComparatorEx<T>
thenComparingLong
(ToLongFunctionEx<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparingLong(ToLongFunction)
.default ComparatorEx<T>
thenComparingLong
(ToLongFunction<? super T> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparingLong(ToLongFunction)
.Methods inherited from interface java.util.Comparator
equals
-
Method Details
-
compareEx
Exception-declaring version ofComparator.compare(T, T)
.- Throws:
Exception
- in case of any exceptional case
-
compare
- Specified by:
compare
in interfaceComparator<T>
-
naturalOrder
Serializable
variant ofjava.util.Comparator#naturalOrder()
.- Type Parameters:
T
- theComparable
type of element to be compared
-
reverseOrder
Serializable
variant ofjava.util.Comparator#reverseOrder()
.- Type Parameters:
T
- theComparable
type of element to be compared
-
nullsFirst
Serializable
variant ofjava.util.Comparator#nullsFirst(Comparator)
.- Type Parameters:
T
- the type of the elements to be compared
-
nullsFirst
Serializable
variant ofjava.util.Comparator#nullsFirst(Comparator)
.- Type Parameters:
T
- the type of the elements to be compared
-
nullsLast
Serializable
variant ofjava.util.Comparator#nullsLast(Comparator)
.- Type Parameters:
T
- the type of the elements to be compared
-
nullsLast
Serializable
variant ofjava.util.Comparator#nullsLast(Comparator)
.- Type Parameters:
T
- the type of the elements to be compared
-
comparing
static <T,U> ComparatorEx<T> comparing(Function<? super T, ? extends U> toKeyFn, Comparator<? super U> keyComparator) Serializable
variant ofjava.util.Comparator#comparing(Function, Comparator)
.- Type Parameters:
T
- the type of element to be comparedU
- the type of the sort key
-
comparing
static <T,U> ComparatorEx<T> comparing(FunctionEx<? super T, ? extends U> toKeyFn, ComparatorEx<? super U> keyComparator) Serializable
variant ofjava.util.Comparator#comparing(Function, Comparator)
.- Type Parameters:
T
- the type of element to be comparedU
- the type of the sort key
-
comparing
static <T,U extends Comparable<? super U>> ComparatorEx<T> comparing(Function<? super T, ? extends U> toKeyFn) Serializable
variant ofjava.util.Comparator#comparing(Function)
.- Type Parameters:
T
- the type of element to be comparedU
- the type of theComparable
sort key
-
comparing
static <T,U extends Comparable<? super U>> ComparatorEx<T> comparing(FunctionEx<? super T, ? extends U> toKeyFn) Serializable
variant ofjava.util.Comparator#comparing(Function)
.- Type Parameters:
T
- the type of element to be comparedU
- the type of theComparable
sort key
-
comparingInt
Serializable
variant ofjava.util.Comparator#comparingInt(ToIntFunction)
.- Type Parameters:
T
- the type of element to be compared
-
comparingInt
Serializable
variant ofjava.util.Comparator#comparingInt(ToIntFunction)
.- Type Parameters:
T
- the type of element to be compared
-
comparingLong
Serializable
variant ofjava.util.Comparator#comparingLong(ToLongFunction)
.- Type Parameters:
T
- the type of element to be compared
-
comparingLong
Serializable
variant ofjava.util.Comparator#comparingLong(ToLongFunction)
.- Type Parameters:
T
- the type of element to be compared
-
comparingDouble
Serializable
variant ofjava.util.Comparator#comparingDouble(ToDoubleFunction)
.- Type Parameters:
T
- the type of element to be compared
-
comparingDouble
Serializable
variant ofjava.util.Comparator#comparingDouble(ToDoubleFunction)
.- Type Parameters:
T
- the type of element to be compared
-
thenComparing
Serializable
variant ofjava.util.Comparator#thenComparing(Comparator)
.- Specified by:
thenComparing
in interfaceComparator<T>
-
thenComparing
Serializable
variant ofjava.util.Comparator#thenComparing(Comparator)
. -
thenComparing
default <U> ComparatorEx<T> thenComparing(Function<? super T, ? extends U> toKeyFn, Comparator<? super U> keyComparator) Serializable
variant ofjava.util.Comparator#thenComparing(Function, Comparator)
.- Specified by:
thenComparing
in interfaceComparator<T>
- Type Parameters:
U
- the type of the sort key
-
thenComparing
default <U> ComparatorEx<T> thenComparing(FunctionEx<? super T, ? extends U> toKeyFn, ComparatorEx<? super U> keyComparator) Serializable
variant ofjava.util.Comparator#thenComparing(Function, Comparator)
.- Type Parameters:
U
- the type of the sort key
-
thenComparing
default <U extends Comparable<? super U>> ComparatorEx<T> thenComparing(Function<? super T, ? extends U> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparing(Function)
.- Specified by:
thenComparing
in interfaceComparator<T>
- Type Parameters:
U
- the type of theComparable
sort key
-
thenComparing
default <U extends Comparable<? super U>> ComparatorEx<T> thenComparing(FunctionEx<? super T, ? extends U> toKeyFn) Serializable
variant ofjava.util.Comparator#thenComparing(Function)
.- Type Parameters:
U
- the type of theComparable
sort key
-
thenComparingInt
Serializable
variant ofjava.util.Comparator#thenComparingInt(ToIntFunction)
.- Specified by:
thenComparingInt
in interfaceComparator<T>
-
thenComparingInt
Serializable
variant ofjava.util.Comparator#thenComparingInt(ToIntFunction)
. -
thenComparingLong
Serializable
variant ofjava.util.Comparator#thenComparingLong(ToLongFunction)
.- Specified by:
thenComparingLong
in interfaceComparator<T>
-
thenComparingLong
Serializable
variant ofjava.util.Comparator#thenComparingLong(ToLongFunction)
. -
thenComparingDouble
Serializable
variant ofjava.util.Comparator#thenComparingDouble(ToDoubleFunction)
.- Specified by:
thenComparingDouble
in interfaceComparator<T>
-
thenComparingDouble
Serializable
variant ofjava.util.Comparator#thenComparingDouble(ToDoubleFunction)
. -
reversed
Serializable
variant ofjava.util.Comparator#reversed()
- Specified by:
reversed
in interfaceComparator<T>
-