lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r358696 - /lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java
Date Fri, 23 Dec 2005 04:03:09 GMT
Author: yonik
Date: Thu Dec 22 20:03:06 2005
New Revision: 358696

URL: http://svn.apache.org/viewcvs?rev=358696&view=rev
Log:
improve hashcodes: LUCENE-460

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java?rev=358696&r1=358695&r2=358696&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/MultiPhraseQuery.java Thu Dec 22 20:03:06
2005
@@ -284,4 +284,24 @@
 
     return buffer.toString();
   }
+
+
+  /** Returns true if <code>o</code> is equal to this. */
+  public boolean equals(Object o) {
+    if (!(o instanceof MultiPhraseQuery)) return false;
+    MultiPhraseQuery other = (MultiPhraseQuery)o;
+    return this.getBoost() == other.getBoost()
+      && this.slop == other.slop
+      && this.termArrays.equals(other.termArrays)
+      && this.positions.equals(other.positions);
+  }
+
+  /** Returns a hash code value for this object.*/
+  public int hashCode() {
+    return Float.floatToIntBits(getBoost())
+      ^ slop
+      ^ termArrays.hashCode()
+      ^ positions.hashCode()
+      ^ 0x4AC65113;
+  }
 }



Mime
View raw message