home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / applets / collectn / elements.jav < prev    next >
Encoding:
Text File  |  1995-10-14  |  1.3 KB  |  48 lines

  1. /*
  2.   File: ElementSortedCollection.java
  3.  
  4.   Originally written by Doug Lea and released into the public domain. 
  5.   Thanks for the assistance and support of Sun Microsystems Labs, Agorics 
  6.   Inc, Loral, and everyone contributing, testing, and using this code.
  7.  
  8.   History:
  9.   Date     Who                What
  10.   24Sep95  dl@cs.oswego.edu   Create from collections.java  working file
  11.   13Oct95  dl                 Changed protection statuses
  12.  
  13. */
  14.   
  15. package collections;
  16.  
  17. import java.util.Enumeration;
  18. import java.util.NoSuchElementException;
  19.  
  20. /**
  21.  *
  22.  *
  23.  * ElementSorted is a mixin interface for Collections that
  24.  * are always in sorted order with respect to a Comparator
  25.  * held by the Collection.
  26.  * <P>
  27.  * ElementSorted Collections guarantee that enumerations
  28.  * appear in sorted order;  that is if a and b are two Elements
  29.  * obtained in succession from elements().nextElement(), that 
  30.  * <PRE>
  31.  * elementComparator().compare(a, b) <= 0.
  32.  * </PRE>
  33.  * @author Doug Lea
  34.  * @version 0.93
  35.  *
  36.  * <P> For an introduction to this package see <A HREF="index.html"> Overview </A>.
  37. **/
  38.  
  39. public interface ElementSortedCollection extends Collection {
  40.  
  41. /**
  42.  * Report the Comparator used for ordering
  43. **/
  44.  
  45.   public Comparator  elementComparator();
  46. };
  47.  
  48.