lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r345449 - /lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
Date Fri, 18 Nov 2005 05:23:55 GMT
Author: yonik
Date: Thu Nov 17 21:23:51 2005
New Revision: 345449

URL: http://svn.apache.org/viewcvs?rev=345449&view=rev
Log:
remove Java5 dependency

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

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java?rev=345449&r1=345448&r2=345449&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java Thu Nov 17
21:23:51 2005
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.Collection;
 
 /**
  * A query that generates the union of the documents produced by its subqueries, and that
scores each document as the maximum
@@ -37,7 +38,7 @@
  * in the multiple fields.
  * @author Chuck Williams
  */
-public class DisjunctionMaxQuery extends Query implements Iterable {
+public class DisjunctionMaxQuery extends Query {
 
   /* The subqueries */
   private ArrayList disjuncts = new ArrayList();
@@ -57,10 +58,10 @@
 
   /**
    * Creates a new DisjunctionMaxQuery
-   * @param disjuncts an Iterable<Query> of all the disjuncts to add
+   * @param disjuncts a Collection<Query> of all the disjuncts to add
    * @param tieBreakerMultiplier   the weight to give to each matching non-maximum disjunct
    */
-  public DisjunctionMaxQuery(Iterable disjuncts, float tieBreakerMultiplier) {
+  public DisjunctionMaxQuery(Collection disjuncts, float tieBreakerMultiplier) {
     this.tieBreakerMultiplier = tieBreakerMultiplier;
     add(disjuncts);
   }
@@ -75,9 +76,8 @@
   /** Add a collection of disjuncts to this disjunction
    * via Iterable<Query>
    */
-  public void add(Iterable disjuncts) {
-    Iterator i = disjuncts.iterator();
-    while (i.hasNext()) add((Query)i.next());
+  public void add(Collection disjuncts) {
+    this.disjuncts.addAll(disjuncts);
   }
 
   /** An Iterator<Query> over the disjuncts */



Mime
View raw message