public class FastComparableComparator extends Object implements Comparator<Object>, Serializable
ComparableComparator
, it will not throw exception when the two compareTo
methods don't provide an inverse result of each other as per the Comparable javadoc. We do so mainly to reduce one
call to compareTo. Constructor and Description |
---|
FastComparableComparator()
Constructs a FastComparableComparator.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object o1,
Object o2) |
static FastComparableComparator |
getInstance()
Return a shared instance of a ComparableComparator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
public FastComparableComparator()
public static FastComparableComparator getInstance()
public int compare(Object o1, Object o2)
compare
in interface Comparator<Object>