lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r787628 - in /lucene/java/trunk/src/java/org/apache/lucene: search/FieldValueHitQueue.java search/HitQueue.java search/TopFieldCollector.java search/TopScoreDocCollector.java util/PriorityQueue.java
Date Tue, 23 Jun 2009 10:48:55 GMT
Author: mikemccand
Date: Tue Jun 23 10:48:55 2009
New Revision: 787628

URL: http://svn.apache.org/viewvc?rev=787628&view=rev
Log:
add javadocs NOTE stating that the core collectors pre-allocate the full array[numHits] up
front

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/FieldValueHitQueue.java
    lucene/java/trunk/src/java/org/apache/lucene/search/HitQueue.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java
    lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java
    lucene/java/trunk/src/java/org/apache/lucene/util/PriorityQueue.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/FieldValueHitQueue.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/FieldValueHitQueue.java?rev=787628&r1=787627&r2=787628&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/FieldValueHitQueue.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/FieldValueHitQueue.java Tue Jun 23
10:48:55 2009
@@ -173,6 +173,9 @@
   /**
    * Creates a hit queue sorted by the given list of fields.
    * 
+   * <p><b>NOTE</b>: The instances returned by this method
+   * pre-allocate a full array of length <code>numHits</code>.
+   * 
    * @param fields
    *          SortField array we are sorting by in priority order (highest
    *          priority first); cannot be <code>null</code> or empty

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/HitQueue.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/HitQueue.java?rev=787628&r1=787627&r2=787628&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/HitQueue.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/HitQueue.java Tue Jun 23 10:48:55
2009
@@ -53,6 +53,9 @@
    * }
    * </pre>
    * 
+   * <p><b>NOTE</b>: This class pre-allocate a full array of
+   * length <code>size</code>.
+   * 
    * @param size
    *          the requested size of this queue.
    * @param prePopulate

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java?rev=787628&r1=787627&r2=787628&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TopFieldCollector.java Tue Jun 23
10:48:55 2009
@@ -810,7 +810,12 @@
   }
 
   /**
-   * Creates a new {@link TopFieldCollector} from the given arguments.
+   * Creates a new {@link TopFieldCollector} from the given
+   * arguments.
+   *
+   * <p><b>NOTE</b>: The instances returned by this method
+   * pre-allocate a full array of length
+   * <code>numHits</code>.
    * 
    * @param sort
    *          the sort criteria (SortFields).

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java?rev=787628&r1=787627&r2=787628&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/TopScoreDocCollector.java Tue Jun
23 10:48:55 2009
@@ -80,6 +80,11 @@
    * Creates a new {@link TopScoreDocCollector} given the number of hits to
    * collect and whether documents are scored in order by the input
    * {@link Scorer} to {@link #setScorer(Scorer)}.
+   *
+   * <p><b>NOTE</b>: The instances returned by this method
+   * pre-allocate a full array of length
+   * <code>numHits</code>, and fill the array with sentinel
+   * objects.
    */
   public static TopScoreDocCollector create(int numHits, boolean docsScoredInOrder) {
     

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/PriorityQueue.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/PriorityQueue.java?rev=787628&r1=787627&r2=787628&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/PriorityQueue.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/PriorityQueue.java Tue Jun 23 10:48:55
2009
@@ -18,8 +18,13 @@
  */
 
 /** A PriorityQueue maintains a partial ordering of its elements such that the
-  least element can always be found in constant time.  Put()'s and pop()'s
-  require log(size) time. */
+ * least element can always be found in constant time.  Put()'s and pop()'s
+ * require log(size) time.
+ *
+ * <p><b>NOTE</b>: This class pre-allocates a full array of
+ * length <code>maxSize+1</code>, in {@link #initialize}.
+  * 
+*/
 public abstract class PriorityQueue {
   private int size;
   private int maxSize;



Mime
View raw message