pal.util
Interface Comparator
- public interface Comparator
interface for an object that can compare other objects for the
purposes of ordering them.
This interface is analogous to the Comparator interface in
Java 1.2 and higher, and it should be superceded by the collections
framework when PAL is moved to 1.2 or higher.
Method Summary |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Returns a number representing the ordering relationship that
the two objects have.
|
boolean |
equals(java.lang.Object o1,
java.lang.Object o2)
Returns true if the two objects are equal. |
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Returns a number representing the ordering relationship that
the two objects have.
A negative number indicates that the first object is "smaller" than
the second object, a positive number means it is "larger" and zero
indicates that the objects are equal.
equals
public boolean equals(java.lang.Object o1,
java.lang.Object o2)
- Returns true if the two objects are equal.