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.
@FunctionalInterface public interface ComparatorEx<T> extends Comparator<T>, Serializable
Serializable
variant of java.util.Comparator
which declares checked exception.- Since:
- 4.0
-
Method Summary
-
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>
-