1 <p> This class defines a <code>compareTo(...)</code> method but inherits its
2 <code>equals()</code> method from <code>java.lang.Object</code>.
3 Generally, the value of compareTo should return zero if and only if
4 equals returns true. If this is violated, weird and unpredictable
5 failures will occur in classes such as PriorityQueue.
6 In Java 5 the PriorityQueue.remove method uses the compareTo method,
7 while in Java 6 it uses the equals method.
9 <p>From the JavaDoc for the compareTo method in the Comparable interface:
11 It is strongly recommended, but not strictly required that <code>(x.compareTo(y)==0) == (x.equals(y))</code>.
12 Generally speaking, any class that implements the Comparable interface and violates this condition
13 should clearly indicate this fact. The recommended language
14 is "Note: this class has a natural ordering that is inconsistent with equals."