import java.util.Comparator;
import IncomparableException;

/**
 * Things that you can tell to sort themselves.
 *
 * @author Samuel A. Rebelsky
 * @version 1.2 of October 2000
 */
public interface Sortable {
  /**
   * Sort the contents of the thing using an ordering to determine
   * the relative position of pairs of elements.
   * Pre: The elements can be compared.
   * Post: The elements are sorted.  Each element is no greater
   *   the the next element.
   * Post: No elements are added or deleted.
   *
   * @exception IncomprableException
   *   if there are pairs of elements that cannot be compared.
   *   (Yes, I know that Comparators throw ClassCastExceptions,
   *   but I believe that's an atrocious idea.
   */
  public void sort(Comparator compare)
    throws IncomparableException;
} // interface Sortable

