org.apache.lucene.codecs

## Class StoredFieldsReader

- java.lang.Object
- - org.apache.lucene.codecs.StoredFieldsReader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Cloneable, Accountable
  Direct Known Subclasses:
    CompressingStoredFieldsReader

      public abstract class StoredFieldsReader
      extends Object
      implements Cloneable, Closeable, Accountable

  Codec API for reading stored fields.

  You need to implement `visitDocument(int, StoredFieldVisitor)` to read the stored fields for a document, implement `clone()` (creating clones of any IndexInputs used, etc), and `Closeable.close()`

  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `StoredFieldsReader()` Sole constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `checkIntegrity()` Checks consistency of this reader.
    `abstract StoredFieldsReader` | `clone()`
    `StoredFieldsReader` | `getMergeInstance()` Returns an instance optimized for merging.
    `abstract void` | `visitDocument(int docID, StoredFieldVisitor visitor)` Visit the stored fields for document `docID`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.io.Closeable

      `close`

    - ### Methods inherited from interface org.apache.lucene.util.Accountable

      `getChildResources, ramBytesUsed`

- - ### Constructor Detail

    - #### StoredFieldsReader

          protected StoredFieldsReader()

      Sole constructor. (For invocation by subclass constructors, typically implicit.)

  - ### Method Detail

    - #### visitDocument

          public abstract void visitDocument(int docID,
                                             StoredFieldVisitor visitor)
                                      throws IOException

      Visit the stored fields for document `docID`
      Throws:
        `IOException`

    - #### clone

          public abstract StoredFieldsReader clone()

      Overrides:
        `clone` in class `Object`

    - #### checkIntegrity

          public abstract void checkIntegrity()
                                       throws IOException

      Checks consistency of this reader.

      Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.

      Throws:
        `IOException`
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### getMergeInstance

          public StoredFieldsReader getMergeInstance()
                                              throws IOException

      Returns an instance optimized for merging.

      The default implementation returns `this`

      Throws:
        `IOException`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.