DirectMonotonicReader (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.util.packed, class: DirectMonotonicReader

Package org.apache.lucene.util.packed

# Class DirectMonotonicReader

java.lang.Object
org.apache.lucene.util.LongValues
org.apache.lucene.util.packed.DirectMonotonicReader

public final class DirectMonotonicReader extends LongValues
Retrieves an instance previously written by `DirectMonotonicWriter`.

See Also:
  - `DirectMonotonicWriter`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `DirectMonotonicReader.Meta`
  In-memory metadata that needs to be kept around for `DirectMonotonicReader` to read data from disk.

- ## Field Summary

  ### Fields inherited from class org.apache.lucene.util.LongValues

  `IDENTITY, ZEROES`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `binarySearch(long fromIndex, long toIndex, long key)`
  Return the index of a key if it exists, or its insertion point otherwise like `Arrays.binarySearch(long[], int, int, long)`.
  `long`
  `get(long index)`
  Get value at `index`.
  `static DirectMonotonicReader`
  `getInstance(DirectMonotonicReader.Meta meta, RandomAccessInput data)`
  Retrieves a non-merging instance from the specified slice.
  `static DirectMonotonicReader`
  `getInstance(DirectMonotonicReader.Meta meta, RandomAccessInput data, boolean merging)`
  Retrieves an instance from the specified slice.
  `static DirectMonotonicReader.Meta`
  `loadMeta(IndexInput metaIn, long numValues, int blockShift)`
  Load metadata from the given `IndexInput`.

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

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

- ## Method Details

  - ### loadMeta

    public static DirectMonotonicReader.Meta loadMeta(IndexInput metaIn, long numValues, int blockShift) throws IOException
    Load metadata from the given `IndexInput`.
    Throws:
      `IOException`
    See Also:
      - `getInstance(Meta, RandomAccessInput)`

  - ### getInstance

    public static DirectMonotonicReader getInstance(DirectMonotonicReader.Meta meta, RandomAccessInput data) throws IOException
    Retrieves a non-merging instance from the specified slice.
    Throws:
      `IOException`

  - ### getInstance

    public static DirectMonotonicReader getInstance(DirectMonotonicReader.Meta meta, RandomAccessInput data, boolean merging) throws IOException
    Retrieves an instance from the specified slice.
    Throws:
      `IOException`

  - ### get

    public long get(long index)
    Description copied from class: `LongValues`
    Get value at `index`.
    Specified by:
      `get` in class `LongValues`

  - ### binarySearch

    public long binarySearch(long fromIndex, long toIndex, long key)
    Return the index of a key if it exists, or its insertion point otherwise like `Arrays.binarySearch(long[], int, int, long)`.
    See Also:
      - `Arrays.binarySearch(long[], int, int, long)`