lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r416440 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/document/Document.java
Date Thu, 22 Jun 2006 18:37:32 GMT
Author: dnaber
Date: Thu Jun 22 11:37:32 2006
New Revision: 416440

URL: http://svn.apache.org/viewvc?rev=416440&view=rev
Log:
LUCENE-608: deprecate Document.fields(), add getFields()

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/document/Document.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=416440&r1=416439&r2=416440&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Thu Jun 22 11:37:32 2006
@@ -10,7 +10,8 @@
     (Samphan Raruenrom va Chris Hostetter)
 
  2. LUCENE-545: New FieldSelector API and associated changes to IndexReader and implementations.
-    New Fieldable interface for use with the lazy field loading mechanism. (Grant Ingersoll
and Chuck Williams via Grant Ingersoll)
+    New Fieldable interface for use with the lazy field loading mechanism.
+    (Grant Ingersoll and Chuck Williams via Grant Ingersoll)
 
 API Changes
 
@@ -21,9 +22,13 @@
     and is supposed to be replaced with the WordlistLoader class in
     package org.apache.lucene.analysis (Daniel Naber)
     
-10. LUCENE-609: Revert return type of Document.getField(s) to Field
+ 3. LUCENE-609: Revert return type of Document.getField(s) to Field
     for backward compatibility, added new Document.getFieldable(s)
     for access to new lazy loaded fields. (Yonik Seeley)
+    
+ 4. LUCENE-608: Document.fields() has been deprecated and a new method 
+    Document.getFields() has been added that returns a List instead of
+    an Enumeration (Daniel Naber)
        
 Bug fixes
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/document/Document.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/document/Document.java?rev=416440&r1=416439&r2=416440&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/document/Document.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/document/Document.java Thu Jun 22 11:37:32
2006
@@ -168,11 +168,22 @@
     return null;
   }
 
-  /** Returns an Enumeration of all the fields in a document. */
+  /** Returns an Enumeration of all the fields in a document.
+   * @deprecated use {@link #getFields()} instead
+   */
   public final Enumeration fields() {
     return ((Vector)fields).elements();
   }
 
+  /** Returns a List of all the fields in a document.
+   * <p>Note that fields which are <i>not</i> {@link Fieldable#isStored()
stored} are
+   * <i>not</i> available in documents retrieved from the index, e.g. with {@link
+   * Hits#doc(int)}, {@link Searcher#doc(int)} or {@link IndexReader#document(int)}.
+   */
+  public final List getFields() {
+    return fields;
+  }
+
   /**
    * Returns an array of {@link Field}s with the given name.
    * This method can return <code>null</code>.
@@ -202,7 +213,7 @@
    * This method can return <code>null</code>.
    *
    * @param name the name of the field
-   * @return a <code>Fieldable[]</code> array
+   * @return a <code>Fieldable[]</code> array or <code>null</code>
    */
    public Fieldable[] getFieldables(String name) {
      List result = new ArrayList();
@@ -225,7 +236,7 @@
    * This method can return <code>null</code>.
    *
    * @param name the name of the field
-   * @return a <code>String[]</code> of field values
+   * @return a <code>String[]</code> of field values or <code>null</code>
    */
   public final String[] getValues(String name) {
     List result = new ArrayList();
@@ -247,7 +258,7 @@
   * binary fields with the specified name are available.
   *
   * @param name the name of the field
-  * @return a  <code>byte[][]</code> of binary field values.
+  * @return a  <code>byte[][]</code> of binary field values or <code>null</code>
   */
   public final byte[][] getBinaryValues(String name) {
     List result = new ArrayList();
@@ -270,7 +281,7 @@
   * There may be non-binary fields with the same name.
   *
   * @param name the name of the field.
-  * @return a <code>byte[]</code> containing the binary field value.
+  * @return a <code>byte[]</code> containing the binary field value or <code>null</code>
   */
   public final byte[] getBinaryValue(String name) {
     for (int i=0; i < fields.size(); i++) {



Mime
View raw message