package rpi.goldsd.container;
/**
* 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.
*
* @see AssociativeContainer
* @see ListNode
* @version 1.0, 3/15/98
* @author David Goldschmidt
*/
public interface Comparable
{
/**
* 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.
* @param C the explicit Comparable object to be compared.
* @return true if the implicit Comparable object is
* equal to the given Comparable object C;
* false otherwise.
*/
public boolean isEqualTo( Comparable C );
/**
* Returns true if the implicit Comparable object is
* less than the given Comparable object C.
* @param C the explicit Comparable object to be compared.
* @return true if the implicit Comparable object is
* less than the given Comparable object C;
* false otherwise.
*/
public boolean isLessThan( Comparable C );
}