public final class ReverseOrderComparator<T> extends Object implements 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> Comparator<T> |
reverse(Comparator<T> comparator)
Reverses the given comparator and returns the resulting comparator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static <T> Comparator<T> reverse(Comparator<T> comparator)
T
- the generic type for the compared valuescomparator
- the comparator to reversecomparator
argumentCopyright © 2024. All rights reserved.