home *** CD-ROM | disk | FTP | other *** search
/ Internet News 1999 October / INEWS_10_CD.ISO / pc / jdk / jdk1.2.2 / docs / tooldocs / javadoc / source / ClassComparator.java next >
Encoding:
Java Source  |  1999-09-19  |  1.1 KB  |  39 lines

  1. /*
  2.  * @(#)ClassComparator.java    1.7 98/09/21
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package com.sun.tools.doclets;
  16.  
  17. import com.sun.javadoc.*;
  18. import java.util.*;
  19.  
  20. /**
  21.  * Comparator to be used to compare the class names.
  22.  */
  23. public class ClassComparator implements Comparator {
  24.  
  25.     /**
  26.      * Compare the classnames of classes represented by two
  27.      * {@link com.sun.javadoc.ClassDoc} objects.
  28.      *
  29.      * @param   o1 ClassDoc object1
  30.      * @param   o2 ClassDoc object2
  31.      * @return  Return the value returned by {@link java.lang.String#compareTo}
  32.      *          method from java.lang.String class.
  33.      */
  34.     public int compare(Object o1, Object o2) {
  35.         return (((ClassDoc)o1).name())
  36.             .compareTo(((ClassDoc)o2).name());
  37.     }
  38. }
  39.