T - The type to comparepublic class ReverseComparator<T> extends Object implements Comparator<T>
Comparator implementation compares to Comparables but
reverses the result of the comparison.| Constructor and Description |
|---|
ReverseComparator(Comparator<T> comparator)
Creates a new comparator that reverse the given comparator.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(T o1,
T o2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic ReverseComparator(Comparator<T> comparator)
comparator - The comparator to reversepublic int compare(T o1, T o2)
compare in interface Comparator<T>Comparator.compare(java.lang.Object, java.lang.Object)Copyright © 2026. All rights reserved.