diff options
Diffstat (limited to 'core/src/main/java/org/elasticsearch/index/fielddata/SortedNumericDoubleValues.java')
-rw-r--r-- | core/src/main/java/org/elasticsearch/index/fielddata/SortedNumericDoubleValues.java | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/SortedNumericDoubleValues.java b/core/src/main/java/org/elasticsearch/index/fielddata/SortedNumericDoubleValues.java index 23cdfa7c0d..d0d9fc4b4c 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/SortedNumericDoubleValues.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/SortedNumericDoubleValues.java @@ -21,6 +21,8 @@ package org.elasticsearch.index.fielddata; import org.apache.lucene.index.SortedNumericDocValues; +import java.io.IOException; + /** * Clone of {@link SortedNumericDocValues} for double values. */ @@ -30,21 +32,25 @@ public abstract class SortedNumericDoubleValues { * constructors, typically implicit.) */ protected SortedNumericDoubleValues() {} - /** - * Positions to the specified document - */ - public abstract void setDocument(int doc); + /** Advance the iterator to exactly {@code target} and return whether + * {@code target} has a value. + * {@code target} must be greater than or equal to the current + * doc ID and must be a valid doc ID, ie. ≥ 0 and + * < {@code maxDoc}.*/ + public abstract boolean advanceExact(int target) throws IOException; - /** - * Retrieve the value for the current document at the specified index. - * An index ranges from {@code 0} to {@code count()-1}. + /** + * Iterates to the next value in the current document. Do not call this more than + * {@link #docValueCount} times for the document. */ - public abstract double valueAt(int index); - - /** - * Retrieves the count of values for the current document. - * This may be zero if a document has no values. + public abstract double nextValue() throws IOException; + + /** + * Retrieves the number of values for the current document. This must always + * be greater than zero. + * It is illegal to call this method after {@link #advanceExact(int)} + * returned {@code false}. */ - public abstract int count(); + public abstract int docValueCount(); } |