You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/10/28 07:41:46 UTC

svn commit: r1634790 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/search/FieldComparator.java

Author: rmuir
Date: Tue Oct 28 06:41:45 2014
New Revision: 1634790

URL: http://svn.apache.org/r1634790
Log:
LUCENE-6027: fix visibility issues in field comparators

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java?rev=1634790&r1=1634789&r2=1634790&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java (original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java Tue Oct 28 06:41:45 2014
@@ -261,7 +261,11 @@ public abstract class FieldComparator<T>
     private double bottom;
     private double topValue;
 
-    DoubleComparator(int numHits, String field, Double missingValue) {
+    /** 
+     * Creates a new comparator based on {@link Double#compare} for {@code numHits}.
+     * When a document has no value for the field, {@code missingValue} is substituted. 
+     */
+    public DoubleComparator(int numHits, String field, Double missingValue) {
       super(field, missingValue);
       values = new double[numHits];
     }
@@ -329,7 +333,11 @@ public abstract class FieldComparator<T>
     private float bottom;
     private float topValue;
 
-    FloatComparator(int numHits, String field, Float missingValue) {
+    /** 
+     * Creates a new comparator based on {@link Float#compare} for {@code numHits}.
+     * When a document has no value for the field, {@code missingValue} is substituted. 
+     */
+    public FloatComparator(int numHits, String field, Float missingValue) {
       super(field, missingValue);
       values = new float[numHits];
     }
@@ -398,7 +406,11 @@ public abstract class FieldComparator<T>
     private int bottom;                           // Value of bottom of queue
     private int topValue;
 
-    IntComparator(int numHits, String field, Integer missingValue) {
+    /** 
+     * Creates a new comparator based on {@link Integer#compare} for {@code numHits}.
+     * When a document has no value for the field, {@code missingValue} is substituted. 
+     */
+    public IntComparator(int numHits, String field, Integer missingValue) {
       super(field, missingValue);
       values = new int[numHits];
     }
@@ -466,7 +478,11 @@ public abstract class FieldComparator<T>
     private long bottom;
     private long topValue;
 
-    LongComparator(int numHits, String field, Long missingValue) {
+    /** 
+     * Creates a new comparator based on {@link Long#compare} for {@code numHits}.
+     * When a document has no value for the field, {@code missingValue} is substituted. 
+     */
+    public LongComparator(int numHits, String field, Long missingValue) {
       super(field, missingValue);
       values = new long[numHits];
     }
@@ -541,7 +557,8 @@ public abstract class FieldComparator<T>
     private Scorer scorer;
     private float topValue;
 
-    RelevanceComparator(int numHits) {
+    /** Creates a new comparator based on relevance for {@code numHits}. */
+    public RelevanceComparator(int numHits) {
       scores = new float[numHits];
     }
 
@@ -618,7 +635,8 @@ public abstract class FieldComparator<T>
     private int bottom;
     private int topValue;
 
-    DocComparator(int numHits) {
+    /** Creates a new comparator based on document ids for {@code numHits} */
+    public DocComparator(int numHits) {
       docIDs = new int[numHits];
     }