public final class ReverseOrderComparator<T> extends java.lang.Object implements java.util.Comparator<T>
Comparator but reverses the order. The
class provides a static reverse(Comparator) method but no public
constructor.| Modifier and Type | Method and Description |
|---|---|
int |
compare(T o1,
T o2) |
static <T> java.util.Comparator<T> |
reverse(java.util.Comparator<T> comparator)
Reverses the given comparator and returns the resulting comparator.
|
public static <T> java.util.Comparator<T> reverse(java.util.Comparator<T> comparator)
T - the generic type for the compared valuescomparator - the comparator to reversecomparator argumentCopyright © 2021. All Rights Reserved.