|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface should be implemented by all classes which wish to define a natural ordering of their instances. The ordering rule must be transitive and invertable (i.e. the sign of the result of x.compareTo(y) must equal the negation of the sign of the result of y.compareTo(x) for all x and y).
In addition, it is desireable (but not required) that when the result of x.compareTo(y) is zero (and only then) the result of x.equals(y) should be true.
Method Summary | |
int |
compareTo(java.lang.Object another)
Answers an integer indicating the relative positions of the receiver and the argument in the natural order of elements of the receiver's class. |
Method Detail |
public int compareTo(java.lang.Object another)
another
- Object an object to compare the receiver to
ClassCastException
- if the argument can not be converted into something
comparable with the receiver.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |