org.apache.lucene.index

## Class LeafReaderContext

- java.lang.Object
- - org.apache.lucene.index.IndexReaderContext
  - - org.apache.lucene.index.LeafReaderContext

-     public final class LeafReaderContext
      extends IndexReaderContext

  `IndexReaderContext` for `LeafReader` instances.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `docBase` The reader's absolute doc base
    `int` | `ord` The reader's ord in the top-level's leaves array

    - ### Fields inherited from class org.apache.lucene.index.IndexReaderContext

      `docBaseInParent, isTopLevel, ordInParent, parent`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<IndexReaderContext>` | `children()` Returns the context's children iff this context is a composite context otherwise `null`.
    `List<LeafReaderContext>` | `leaves()` Returns the context's leaves if this context is a top-level context.
    `LeafReader` | `reader()` Returns the `IndexReader`, this context represents.
    `String` | `toString()`

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

      `id`

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

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

- - ### Field Detail

    - #### ord

          public final int ord

      The reader's ord in the top-level's leaves array

    - #### docBase

          public final int docBase

      The reader's absolute doc base

  - ### Method Detail

    - #### leaves

          public List<LeafReaderContext> leaves()

      Description copied from class: `IndexReaderContext`
      Returns the context's leaves if this context is a top-level context. For convenience, if this is an `LeafReaderContext` this returns itself as the only leaf.

      Note: this is convenience method since leaves can always be obtained by walking the context tree using `IndexReaderContext.children()`.

      Specified by:
        `leaves` in class `IndexReaderContext`
      See Also:
        `IndexReaderContext.children()`

    - #### children

          public List<IndexReaderContext> children()

      Description copied from class: `IndexReaderContext`
      Returns the context's children iff this context is a composite context otherwise `null`.
      Specified by:
        `children` in class `IndexReaderContext`

    - #### reader

          public LeafReader reader()

      Description copied from class: `IndexReaderContext`
      Returns the `IndexReader`, this context represents.
      Specified by:
        `reader` in class `IndexReaderContext`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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