All Packages Class Hierarchy This Package Previous Next Index
Interface rpi.goldsd.container.Comparable
- public interface Comparable
The Comparable interface defines the methods required by any
object that can be compared to other objects of the same type.
Many other classes defined in this package maintain sets of
Comparable (and Hashable) objects such that
sorting, searching, and other order-dependent operations may be
performed in a generic manner.
Classes implementing the Comparable interface should provide
a strict total ordering of elements. In other words, every
pair of elements must be related by the > and
== operators in in the following manner
(from David Musser's STL Tutorial and Reference Guide):
- Transitivity: for every x, y, z
in S, if x R y and y R z, then
x R z.
- Trichotomy: for every x and y in
S, exactly one of the following is true: x R y,
y R x, or x == y.
Note that the == operator implicitly adheres to the
given Trichotomy rule.
- Version:
- 1.0, 3/15/98
- Author:
- David Goldschmidt
- See Also:
- AssociativeContainer, ListNode
-
isEqualTo(Comparable)
- Returns true if the implicit Comparable object is
equal to the given Comparable object C.
-
isLessThan(Comparable)
- Returns true if the implicit Comparable object is
less than the given Comparable object C.
isEqualTo
public abstract boolean isEqualTo(Comparable C)
- Returns true if the implicit Comparable object is
equal to the given Comparable object C. Essentially,
this method is used to define the equivalence relation on the
given type implementing the Comparable interface.
- Parameters:
- C - the explicit Comparable object to be compared.
- Returns:
- true if the implicit Comparable object is
equal to the given Comparable object C;
false otherwise.
isLessThan
public abstract boolean isLessThan(Comparable C)
- Returns true if the implicit Comparable object is
less than the given Comparable object C.
- Parameters:
- C - the explicit Comparable object to be compared.
- Returns:
- true if the implicit Comparable object is
less than the given Comparable object C;
false otherwise.
All Packages Class Hierarchy This Package Previous Next Index