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

  1. /*
  2.   File: Comparator.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.  
  12. */
  13.   
  14. package collections;
  15.  
  16. import java.util.Enumeration;
  17. import java.util.NoSuchElementException;
  18.  
  19. /**
  20.  *
  21.  * Comparator is an interface for any class possessing an element
  22.  * comparison method.
  23.  * @author Doug Lea
  24.  * @version 0.93
  25.  *
  26.  * <P> For an introduction to this package see <A HREF="index.html"> Overview </A>.
  27.  *
  28. **/
  29.  
  30. public interface Comparator {
  31.  
  32. /**
  33.  * Compare two Objects with respect to ordering. Typical
  34.  * implementations first cast their arguments to particular
  35.  * types in order to perform comparison
  36.  *
  37.  * @param fst first argument
  38.  * @param snd second argument
  39.  * @return a negative number if fst is less than snd; a
  40.  * positive number if fst is greater than snd; else 0
  41. **/
  42.   public int        compare(Object fst, Object snd); 
  43. }
  44.  
  45.