public class DefaultComparator extends Object implements Comparator
Modifier | Constructor and Description |
---|---|
protected |
DefaultComparator()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Object o1,
Object o2)
Compares two Objects using the toString() method as the value of each object
to compare.
|
static DefaultComparator |
getInstance()
Returns ObjectComparator singleton.
|
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
protected DefaultComparator()
public static DefaultComparator getInstance()
public int compare(Object o1, Object o2)
compare
in interface Comparator
o1
- the first object to be comparedo2
- the second object to be compared