KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > fulltext > dml > Comparator


1 package com.daffodilwoods.daffodildb.server.sql99.fulltext.dml;
2
3 /**
4  * <p>Title: Comparator </p>
5  * <p>Description: This Class handles the hashing of distinct parsed words i.e.
6  * tokens. Hashing is required to avoid duplicate storage of terms with respect
7  * to same document. </p>
8  * <p>Copyright: Copyright (c) 2003</p>
9  * <p>Company: </p>
10  * @author not attributable
11  * @version 1.0
12  */

13 public class Comparator implements java.util.Comparator JavaDoc {
14
15    public Comparator() {
16    }
17
18    /**
19     * Compares the terms(words).
20     * @param o1 first term
21     * @param o2 second term
22     * @return Returns -
23     * 0 if both are same ,
24     * negaitve value if b1 is less than ob2.
25     * and greater than 0 value if b1 is greater than the value ob2.
26     */

27    public int compare(Object JavaDoc o1, Object JavaDoc o2) {
28       return ((Comparable JavaDoc)o1).compareTo(o2);
29    }
30 }
31
Popular Tags