class MyComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.Object>
Constructor and Description |
---|
MyComparator(boolean ascending) |
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object lhs,
java.lang.Object rhs)
Compare 2 objects.
If they are of the same class and instance of Comparable, call compareTo to compare. otherwise, use their hash-code to compare. If the objects are of Class, we want to use their class-name to compare. |
public int compare(java.lang.Object lhs, java.lang.Object rhs)
compare
in interface java.util.Comparator<java.lang.Object>
Copyright © SAS Institute. All Rights Reserved.