public class GeneralComparator
extends java.lang.Object
implements java.util.Comparator
Comparable
interface. This method returns
-1, 0, or 1 if object_1 is less than, equal to, or bigger than object_2.Green (hyzheng) |
Green (hyzheng) |
Constructor and Description |
---|
GeneralComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object first,
java.lang.Object second)
Return -1, 0, or 1 if the first object is less than, equal to, or
bigger than the second object.
|
public int compare(java.lang.Object first, java.lang.Object second)
If any of the argument is not a object of Comparable class, a ClassCastException will be thrown.
compare
in interface java.util.Comparator
first
- The first comparable object.second
- The second comparable object.