Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 71700 invoked from network); 22 Jun 2006 18:37:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jun 2006 18:37:55 -0000 Received: (qmail 24754 invoked by uid 500); 22 Jun 2006 18:37:54 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 24729 invoked by uid 500); 22 Jun 2006 18:37:54 -0000 Mailing-List: contact java-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-commits@lucene.apache.org Received: (qmail 24711 invoked by uid 99); 22 Jun 2006 18:37:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 11:37:54 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 11:37:53 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 6748D1A983A; Thu, 22 Jun 2006 11:37:33 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: java-commits@lucene.apache.org From: dnaber@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060622183733.6748D1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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. + *

Note that fields which are not {@link Fieldable#isStored() stored} are + * not 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 null. @@ -202,7 +213,7 @@ * This method can return null. * * @param name the name of the field - * @return a Fieldable[] array + * @return a Fieldable[] array or null */ public Fieldable[] getFieldables(String name) { List result = new ArrayList(); @@ -225,7 +236,7 @@ * This method can return null. * * @param name the name of the field - * @return a String[] of field values + * @return a String[] of field values or null */ 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 byte[][] of binary field values. + * @return a byte[][] of binary field values or null */ 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 byte[] containing the binary field value. + * @return a byte[] containing the binary field value or null */ public final byte[] getBinaryValue(String name) { for (int i=0; i < fields.size(); i++) {