cutting     2004/03/24 09:32:49

  Modified:    src/java/org/apache/lucene/index Term.java
  Log:
  Changed Term to implement Comparable.
  
  Revision  Changes    Path
  1.5       +5 -1      jakarta-lucene/src/java/org/apache/lucene/index/Term.java
  
  Index: Term.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/Term.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Term.java 13 Jan 2003 23:50:33 -0000      1.4
  +++ Term.java 24 Mar 2004 17:32:49 -0000      1.5
  @@ -62,7 +62,7 @@
     Note that terms may represent more than words from text fields, but also
     things like dates, email addresses, urls, etc.  */
   
  -public final class Term implements java.io.Serializable {
  +public final class Term implements Comparable, java.io.Serializable {
     String field;
     String text;
     
  @@ -96,6 +96,10 @@
     /** Combines the hashCode() of the field and the text. */
     public final int hashCode() {
       return field.hashCode() + text.hashCode();
  +  }
  +
  +  public int compareTo(Object other) {
  +    return compareTo((Term)other);
     }
   
     /** Compares two terms, returning an integer which is less than zero iff this
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to