Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

javadocs

Robert Muir6cfa54fd4763
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java
index 2e35e279c91..abf1068b2d1 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java
@@ -225,8 +225,11 @@ public abstract class PerFieldPostingsFormat extends PostingsFormat {
return new FieldsReader(state);
}
- // NOTE: only called during writing; for reading we read
- // all we need from the index (ie we save the field ->
- // format mapping)
+ /**
+ * Returns the postings format that should be used for writing
+ * new segments of <code>field</code>.
+ * <p>
+ * The field to format mapping is written to the index, so
+ * this method is only invoked when writing, not when reading. */
public abstract PostingsFormat getPostingsFormatForField(String field);
}
diff --git a/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java b/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java
index 9dd68a5ed83..0df8bc752c2 100644
--- a/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java
@@ -260,10 +260,12 @@ public class FilteredQuery extends Query {
}
}
+ /** Returns this FilteredQuery's (unfiltered) Query */
public final Query getQuery() {
return query;
}
+ /** Returns this FilteredQuery's filter */
public final Filter getFilter() {
return filter;
}
diff --git a/lucene/core/src/java/org/apache/lucene/search/Scorer.java b/lucene/core/src/java/org/apache/lucene/search/Scorer.java
index 98b7ddcd0ad..5da508c07fc 100644
--- a/lucene/core/src/java/org/apache/lucene/search/Scorer.java
+++ b/lucene/core/src/java/org/apache/lucene/search/Scorer.java
@@ -40,6 +40,8 @@ import java.util.Collections;
* with these scores.
*/
public abstract class Scorer extends DocIdSetIterator {
+ /** the Scorer's parent Weight. in some cases this may be null */
+ // TODO can we clean this up?
protected final Weight weight;
/**
diff --git a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
index 84811ec5f73..c1c7f5aa007 100644
--- a/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
@@ -78,6 +78,10 @@ import org.apache.lucene.util.Constants;
*/
public class MMapDirectory extends FSDirectory {
private boolean useUnmapHack = UNMAP_SUPPORTED;
+ /**
+ * Default max chunk size.
+ * @see #MMapDirectory(File, LockFactory, int)
+ */
public static final int DEFAULT_MAX_BUFF = Constants.JRE_IS_64BIT ? (1 << 30) : (1 << 28);
final int chunkSizePower;
diff --git a/lucene/core/src/java/org/apache/lucene/util/Bits.java b/lucene/core/src/java/org/apache/lucene/util/Bits.java
index 6c4f5175e96..651cdd0fc93 100644
--- a/lucene/core/src/java/org/apache/lucene/util/Bits.java
+++ b/lucene/core/src/java/org/apache/lucene/util/Bits.java
@@ -23,7 +23,16 @@ package org.apache.lucene.util;
*/
public interface Bits {
+ /**
+ * Returns the value of the bit with the specified <code>index</code>.
+ * @param index index, should be non-negative and &lt; {@link #length()}.
+ * The result of passing negative or out of bounds values is undefined
+ * by this interface, <b>just don't do it!</b>
+ * @return <code>true</code> if the bit is set, <code>false</code> otherwise.
+ */
public boolean get(int index);
+
+ /** Returns the number of bits in this set */
public int length();
public static final Bits[] EMPTY_ARRAY = new Bits[0];
diff --git a/lucene/core/src/java/org/apache/lucene/util/CharsRef.java b/lucene/core/src/java/org/apache/lucene/util/CharsRef.java
index bc917b07888..c1c129ea005 100644
--- a/lucene/core/src/java/org/apache/lucene/util/CharsRef.java
+++ b/lucene/core/src/java/org/apache/lucene/util/CharsRef.java
@@ -26,9 +26,13 @@ import java.util.Comparator;
* @lucene.internal
*/
public final class CharsRef implements Comparable<CharsRef>, CharSequence, Cloneable {
+ /** An empty character array for convenience */
public static final char[] EMPTY_CHARS = new char[0];
+ /** The contents of the CharsRef. Should never be {@code null}. */
public char[] chars;
+ /** Offset of first valid character. */
public int offset;
+ /** Length of used characters. */
public int length;
/**
diff --git a/lucene/core/src/java/org/apache/lucene/util/IntsRef.java b/lucene/core/src/java/org/apache/lucene/util/IntsRef.java
index 6c5fd516cf8..6fa8866178c 100644
--- a/lucene/core/src/java/org/apache/lucene/util/IntsRef.java
+++ b/lucene/core/src/java/org/apache/lucene/util/IntsRef.java
@@ -23,21 +23,32 @@ package org.apache.lucene.util;
*
* @lucene.internal */
public final class IntsRef implements Comparable<IntsRef>, Cloneable {
-
+ /** An empty integer array for convenience */
public static final int[] EMPTY_INTS = new int[0];
+ /** The contents of the IntsRef. Should never be {@code null}. */
public int[] ints;
+ /** Offset of first valid integer. */
public int offset;
+ /** Length of used ints. */
public int length;
+ /** Create a IntsRef with {@link #EMPTY_INTS} */
public IntsRef() {
ints = EMPTY_INTS;
}
+ /**
+ * Create a IntsRef pointing to a new array of size <code>capacity</code>.
+ * Offset and length will both be zero.
+ */
public IntsRef(int capacity) {
ints = new int[capacity];
}
+ /** This instance will directly reference ints w/o making a copy.
+ * ints should not be null.
+ */
public IntsRef(int[] ints, int offset, int length) {
assert ints != null;
assert offset >= 0;
diff --git a/lucene/core/src/java/org/apache/lucene/util/LongsRef.java b/lucene/core/src/java/org/apache/lucene/util/LongsRef.java
index 54ce73abaf7..93fee717f7a 100644
--- a/lucene/core/src/java/org/apache/lucene/util/LongsRef.java
+++ b/lucene/core/src/java/org/apache/lucene/util/LongsRef.java
@@ -23,21 +23,31 @@ package org.apache.lucene.util;
*
* @lucene.internal */
public final class LongsRef implements Comparable<LongsRef>, Cloneable {
-
+ /** An empty long array for convenience */
public static final long[] EMPTY_LONGS = new long[0];
+ /** The contents of the LongsRef. Should never be {@code null}. */
public long[] longs;
+ /** Offset of first valid long. */
public int offset;
+ /** Length of used longs. */
public int length;
+ /** Create a LongsRef with {@link #EMPTY_LONGS} */
public LongsRef() {
longs = EMPTY_LONGS;
}
+ /**
+ * Create a LongsRef pointing to a new array of size <code>capacity</code>.
+ * Offset and length will both be zero.
+ */
public LongsRef(int capacity) {
longs = new long[capacity];
}
+ /** This instance will directly reference longs w/o making a copy.
+ * longs should not be null */
public LongsRef(long[] longs, int offset, int length) {
assert longs != null;
assert offset >= 0;
diff --git a/lucene/core/src/java/org/apache/lucene/util/MutableBits.java b/lucene/core/src/java/org/apache/lucene/util/MutableBits.java
index bb7d93bf4d3..9eedc308d6d 100644
--- a/lucene/core/src/java/org/apache/lucene/util/MutableBits.java
+++ b/lucene/core/src/java/org/apache/lucene/util/MutableBits.java
@@ -21,5 +21,11 @@ package org.apache.lucene.util;
* Extension of Bits for live documents.
*/
public interface MutableBits extends Bits {
- public void clear(int bit);
+ /**
+ * Sets the bit specified by <code>index</code> to false.
+ * @param index index, should be non-negative and &lt; {@link #length()}.
+ * The result of passing negative or out of bounds values is undefined
+ * by this interface, <b>just don't do it!</b>
+ */
+ public void clear(int index);
}