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):

Note that the == operator implicitly adheres to the given Trichotomy rule.

Version:
1.0, 3/15/98
Author:
David Goldschmidt
See Also:
AssociativeContainer, ListNode

Method Index

 o isEqualTo(Comparable)
Returns true if the implicit Comparable object is equal to the given Comparable object C.
 o isLessThan(Comparable)
Returns true if the implicit Comparable object is less than the given Comparable object C.

Methods

 o 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.
 o 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