Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 5939 invoked from network); 19 May 2005 01:52:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 May 2005 01:52:27 -0000 Received: (qmail 16860 invoked by uid 500); 19 May 2005 01:31:01 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 16821 invoked by uid 500); 19 May 2005 01:30:59 -0000 Mailing-List: contact java-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-commits@lucene.apache.org Received: (qmail 16737 invoked by uid 99); 19 May 2005 01:30:57 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 18 May 2005 18:30:55 -0700 Received: (qmail 98137 invoked by uid 65534); 19 May 2005 01:30:45 -0000 Message-ID: <20050519013045.98136.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r170853 - /lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery.java Date: Thu, 19 May 2005 01:30:45 -0000 To: java-commits@lucene.apache.org From: ehatcher@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ehatcher Date: Wed May 18 18:30:43 2005 New Revision: 170853 URL: http://svn.apache.org/viewcvs?rev=3D170853&view=3Drev Log: add .equals/.hashCode to SpanTermQuery to allow comparison and collections = to work logically. The other SpanQuery subclasses should probably have a s= imilar adjustment and I will take care of those as I run into cases where i= t is necessary Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery= .java Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTer= mQuery.java URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lu= cene/search/spans/SpanTermQuery.java?rev=3D170853&r1=3D170852&r2=3D170853&v= iew=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery= .java (original) +++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanTermQuery= .java Wed May 18 18:30:43 2005 @@ -50,6 +50,20 @@ return term.toString(); } =20 + /** Returns true iff o is equal to this. */ + public boolean equals(Object o) { + if (!(o instanceof SpanTermQuery)) + return false; + SpanTermQuery other =3D (SpanTermQuery)o; + return (this.getBoost() =3D=3D other.getBoost()) + && this.term.equals(other.term); + } + + /** Returns a hash code value for this object.*/ + public int hashCode() { + return Float.floatToIntBits(getBoost()) ^ term.hashCode(); + } + public Spans getSpans(final IndexReader reader) throws IOException { return new Spans() { private TermPositions positions =3D reader.termPositions(term);