Package com.oracle.coherence.common.base
Class InverseComparator<T>
java.lang.Object
com.oracle.coherence.common.base.InverseComparator<T>
- All Implemented Interfaces:
Comparator<T>
InverseComparator is a wrapper comparator which simply inverses the comparison result.
- Author:
- mf 2014.08.28
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Comparator
<T> The comparator to invert.static final InverseComparator
InverseComparator singleton which inverts a Comparable objects natural comparison order. -
Constructor Summary
ConstructorDescriptionInverseComparator
(Comparator<T> comparator) Construct an InverseComparator which inverts the specified comparator. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
f_comparator
The comparator to invert. -
INSTANCE
InverseComparator singleton which inverts a Comparable objects natural comparison order.
-
-
Constructor Details
-
InverseComparator
Construct an InverseComparator which inverts the specified comparator.- Parameters:
comparator
- the comparator to invert
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<T>
-