Package com.oracle.coherence.common.base
Class NaturalComparator<T extends Comparable<T>>
- java.lang.Object
-
- com.oracle.coherence.common.base.NaturalComparator<T>
-
- All Implemented Interfaces:
Comparator<T>
public class NaturalComparator<T extends Comparable<T>> extends Object implements Comparator<T>
NaturalComparator is a comparator which simply delegates to a Comparable object's compare implementation.- Author:
- mf 2014.08.28
-
-
Field Summary
Fields Modifier and Type Field Description static NaturalComparator
INSTANCE
NaturalComparator singleton.
-
Constructor Summary
Constructors Constructor Description NaturalComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(T o1, T o2)
-
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 Detail
-
INSTANCE
public static final NaturalComparator INSTANCE
NaturalComparator singleton.
-
-
Method Detail
-
compare
public int compare(T o1, T o2)
- Specified by:
compare
in interfaceComparator<T extends Comparable<T>>
-
-