DthingApi
|
Public Member Functions | |
int | compare (T lhs, T rhs) |
boolean | equals (Object object) |
A
is used to compare two objects to determine their ordering with respect to each other. On a given
, a
can be used to obtain a sorted
which is totally ordered. For a
to be consistent with equals, its {code #compare(Object, Object)} method has to return zero for each pair of elements (a,b) where a.equals(b) holds true. It is recommended that a
implements java.io.Serializable.
int java.util.Comparator< T >.compare | ( | T | lhs, |
T | rhs | ||
) |
Compares the two specified objects to determine their relative ordering. The ordering implied by the return value of this method for all possible pairs of
should form an equivalence relation. This means that
lhs | an Object |
rhs | a second Object lhs |
ClassCastException | if objects are not of the correct type. |
boolean java.util.Comparator< T >.equals | ( | Object | object | ) |
Compares this
with the specified
and indicates whether they are equal. In order to be equal,
must represent the same object as this instance using a class-specific comparison.
A
never needs to override this method, but may choose so for performance reasons.
object | the Object |