org.apache.lucene.index

## Class FilterCodecReader

- java.lang.Object
- - org.apache.lucene.index.IndexReader
  - - org.apache.lucene.index.LeafReader
    - - org.apache.lucene.index.CodecReader
      - - org.apache.lucene.index.FilterCodecReader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Accountable

      public abstract class FilterCodecReader
      extends CodecReader

  A `FilterCodecReader` contains another CodecReader, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.LeafReader

      `LeafReader.CoreClosedListener`

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader

      `IndexReader.ReaderClosedListener`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CodecReader` | `in` The underlying CodecReader instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilterCodecReader(CodecReader in)` Creates a new FilterCodecReader.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCoreClosedListener(LeafReader.CoreClosedListener listener)` Expert: adds a CoreClosedListener to this reader's shared core
    `void` | `checkIntegrity()` Checks consistency of this reader.
    `protected void` | `doClose()` Implements close.
    `Collection<Accountable>` | `getChildResources()` Returns nested resources of this class.
    `DocValuesProducer` | `getDocValuesReader()` Expert: retrieve underlying DocValuesProducer
    `FieldInfos` | `getFieldInfos()` Get the `FieldInfos` describing all fields in this reader.
    `StoredFieldsReader` | `getFieldsReader()` Expert: retrieve thread-private StoredFieldsReader
    `Sort` | `getIndexSort()` Returns null if this leaf is unsorted, or the `Sort` that it was sorted by
    `Bits` | `getLiveDocs()` Returns the `Bits` representing live (not deleted) docs.
    `NormsProducer` | `getNormsReader()` Expert: retrieve underlying NormsProducer
    `PointsReader` | `getPointsReader()` Expert: retrieve underlying PointsReader
    `PointValues` | `getPointValues()` Returns the `PointValues` used for numeric or spatial searches, or null if there are no point fields.
    `FieldsProducer` | `getPostingsReader()` Expert: retrieve underlying FieldsProducer
    `TermVectorsReader` | `getTermVectorsReader()` Expert: retrieve thread-private TermVectorsReader
    `int` | `maxDoc()` Returns one greater than the largest possible document number.
    `int` | `numDocs()` Returns the number of documents in this index.
    `long` | `ramBytesUsed()` Return the memory usage of this object in bytes.
    `void` | `removeCoreClosedListener(LeafReader.CoreClosedListener listener)` Expert: removes a CoreClosedListener from this reader's shared core

    - ### Methods inherited from class org.apache.lucene.index.CodecReader

      `document, fields, getBinaryDocValues, getDocsWithField, getNormValues, getNumericDocValues, getSortedDocValues, getSortedNumericDocValues, getSortedSetDocValues, getTermVectors`

    - ### Methods inherited from class org.apache.lucene.index.LeafReader

      `addCoreClosedListenerAsReaderClosedListener, docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, removeCoreClosedListenerAsReaderClosedListener, terms, totalTermFreq`

    - ### Methods inherited from class org.apache.lucene.index.IndexReader

      `addReaderClosedListener, close, decRef, document, document, ensureOpen, equals, getCombinedCoreAndDeletesKey, getCoreCacheKey, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, removeReaderClosedListener, tryIncRef`

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

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### in

          protected final CodecReader in

      The underlying CodecReader instance.

  - ### Constructor Detail

    - #### FilterCodecReader

          public FilterCodecReader(CodecReader in)

      Creates a new FilterCodecReader.
      Parameters:
        `in` - the underlying CodecReader instance.

  - ### Method Detail

    - #### getFieldsReader

          public StoredFieldsReader getFieldsReader()

      Description copied from class: `CodecReader`
      Expert: retrieve thread-private StoredFieldsReader
      Specified by:
        `getFieldsReader` in class `CodecReader`

    - #### getTermVectorsReader

          public TermVectorsReader getTermVectorsReader()

      Description copied from class: `CodecReader`
      Expert: retrieve thread-private TermVectorsReader
      Specified by:
        `getTermVectorsReader` in class `CodecReader`

    - #### getNormsReader

          public NormsProducer getNormsReader()

      Description copied from class: `CodecReader`
      Expert: retrieve underlying NormsProducer
      Specified by:
        `getNormsReader` in class `CodecReader`

    - #### getDocValuesReader

          public DocValuesProducer getDocValuesReader()

      Description copied from class: `CodecReader`
      Expert: retrieve underlying DocValuesProducer
      Specified by:
        `getDocValuesReader` in class `CodecReader`

    - #### getPostingsReader

          public FieldsProducer getPostingsReader()

      Description copied from class: `CodecReader`
      Expert: retrieve underlying FieldsProducer
      Specified by:
        `getPostingsReader` in class `CodecReader`

    - #### getLiveDocs

          public Bits getLiveDocs()

      Description copied from class: `LeafReader`
      Returns the `Bits` representing live (not deleted) docs. A set bit indicates the doc ID has not been deleted. If this method returns null it means there are no deleted documents (all documents are live). The returned instance has been safely published for use by multiple threads without additional synchronization.
      Specified by:
        `getLiveDocs` in class `LeafReader`

    - #### getFieldInfos

          public FieldInfos getFieldInfos()

      Description copied from class: `LeafReader`
      Get the `FieldInfos` describing all fields in this reader.
      Specified by:
        `getFieldInfos` in class `LeafReader`

    - #### getPointsReader

          public PointsReader getPointsReader()

      Description copied from class: `CodecReader`
      Expert: retrieve underlying PointsReader
      Specified by:
        `getPointsReader` in class `CodecReader`

    - #### getPointValues

          public PointValues getPointValues()

      Description copied from class: `LeafReader`
      Returns the `PointValues` used for numeric or spatial searches, or null if there are no point fields.
      Specified by:
        `getPointValues` in class `LeafReader`

    - #### numDocs

          public int numDocs()

      Description copied from class: `IndexReader`
      Returns the number of documents in this index.
      Specified by:
        `numDocs` in class `IndexReader`

    - #### maxDoc

          public int maxDoc()

      Description copied from class: `IndexReader`
      Returns one greater than the largest possible document number. This may be used to, e.g., determine how big to allocate an array which will have an element for every document number in an index.
      Specified by:
        `maxDoc` in class `IndexReader`

    - #### getIndexSort

          public Sort getIndexSort()

      Description copied from class: `LeafReader`
      Returns null if this leaf is unsorted, or the `Sort` that it was sorted by
      Specified by:
        `getIndexSort` in class `LeafReader`

    - #### addCoreClosedListener

          public void addCoreClosedListener(LeafReader.CoreClosedListener listener)

      Description copied from class: `LeafReader`
      Expert: adds a CoreClosedListener to this reader's shared core
      Specified by:
        `addCoreClosedListener` in class `LeafReader`

    - #### removeCoreClosedListener

          public void removeCoreClosedListener(LeafReader.CoreClosedListener listener)

      Description copied from class: `LeafReader`
      Expert: removes a CoreClosedListener from this reader's shared core
      Specified by:
        `removeCoreClosedListener` in class `LeafReader`

    - #### doClose

          protected void doClose()
                          throws IOException

      Description copied from class: `IndexReader`
      Implements close.
      Overrides:
        `doClose` in class `CodecReader`
      Throws:
        `IOException`

    - #### ramBytesUsed

          public long ramBytesUsed()

      Description copied from interface: `Accountable`
      Return the memory usage of this object in bytes. Negative values are illegal.
      Specified by:
        `ramBytesUsed` in interface `Accountable`
      Overrides:
        `ramBytesUsed` in class `CodecReader`

    - #### getChildResources

          public Collection<Accountable> getChildResources()

      Description copied from interface: `Accountable`
      Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).
      Specified by:
        `getChildResources` in interface `Accountable`
      Overrides:
        `getChildResources` in class `CodecReader`
      See Also:
        `Accountables`

    - #### checkIntegrity

          public void checkIntegrity()
                              throws IOException

      Description copied from class: `LeafReader`
      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.

      Overrides:
        `checkIntegrity` in class `CodecReader`
      Throws:
        `IOException`

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