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 2012/09/20 01:24:18 UTC

svn commit: r1387814 - in /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene: codecs/perfield/ search/ store/ util/

Author: rmuir
Date: Wed Sep 19 23:24:18 2012
New Revision: 1387814

URL: http://svn.apache.org/viewvc?rev=1387814&view=rev
Log:
javadocs

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/Scorer.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/Bits.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/CharsRef.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/IntsRef.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/LongsRef.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/MutableBits.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java Wed Sep 19 23:24:18 2012
@@ -225,8 +225,11 @@ public abstract class PerFieldPostingsFo
     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);
 }

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FilteredQuery.java Wed Sep 19 23:24:18 2012
@@ -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;
   }

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/Scorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/Scorer.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/Scorer.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/Scorer.java Wed Sep 19 23:24:18 2012
@@ -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;
 
   /**

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/MMapDirectory.java Wed Sep 19 23:24:18 2012
@@ -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;
 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/Bits.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/Bits.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/Bits.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/Bits.java Wed Sep 19 23:24:18 2012
@@ -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];

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/CharsRef.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/CharsRef.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/CharsRef.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/CharsRef.java Wed Sep 19 23:24:18 2012
@@ -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;
 
   /**

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/IntsRef.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/IntsRef.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/IntsRef.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/IntsRef.java Wed Sep 19 23:24:18 2012
@@ -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;

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/LongsRef.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/LongsRef.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/LongsRef.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/LongsRef.java Wed Sep 19 23:24:18 2012
@@ -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;

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/MutableBits.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/MutableBits.java?rev=1387814&r1=1387813&r2=1387814&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/MutableBits.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/MutableBits.java Wed Sep 19 23:24:18 2012
@@ -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);
 }