KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > util > ComparableComparator


1 //$Id: ComparableComparator.java,v 1.1 2004/09/04 13:01:55 oneovthafew Exp $
2
package org.hibernate.util;
3
4 import java.util.Comparator JavaDoc;
5
6 /**
7  * Delegates to Comparable
8  * @author Gavin King
9  */

10 public class ComparableComparator implements Comparator JavaDoc {
11
12     public int compare(Object JavaDoc x, Object JavaDoc y) {
13         return ( (Comparable JavaDoc) x ).compareTo(y);
14     }
15     
16     public static final Comparator JavaDoc INSTANCE = new ComparableComparator();
17
18 }
19
Popular Tags