KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > util > SortableCompare


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.util;
11
12 /**
13  * Class to compare two objects, used by SortedVector.
14  * This one is to sort objects supporting the Sortable interface
15  * @see org.mmbase.util.Sortable
16  * @see org.mmbase.util.SortedVector
17  * @see org.mmbase.util.CompareInterface
18  *
19  * @deprecated Use java.util.Comparator
20  * @author Rico Jansen
21  * @version $Id: SortableCompare.java,v 1.9 2005/10/05 12:42:56 michiel Exp $
22  */

23 public class SortableCompare implements CompareInterface {
24
25     /**
26      * Make the comparison.
27      * The result is a negative value if the first object is 'smaller' than the second,
28      * a positive value if it is 'larger', and 0 if both objects are 'equal'.
29      * @param thisOne the first object to compare. should be a <code>Comparable</code>.
30      * @param other the second object to compare. should be a <code>Comparable</code>.
31      * @return the result of the comparison
32      */

33     public int compare(Object JavaDoc thisOne,Object JavaDoc other) {
34         return ((Sortable)thisOne).compare((Sortable)other);
35     }
36 }
37
Popular Tags