Package org.apache.lucene.backward_codecs.packed

# Class LegacyDirectMonotonicReader

java.lang.Object
org.apache.lucene.util.LongValues
org.apache.lucene.backward_codecs.packed.LegacyDirectMonotonicReader

All Implemented Interfaces:
  `Accountable`

public final class LegacyDirectMonotonicReader extends LongValues implements Accountable
Retrieves an instance previously written by `LegacyDirectMonotonicWriter`.

See Also:
  - `LegacyDirectMonotonicWriter`

## Nested Class Summary

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

## Field Summary

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

`IDENTITY, ZEROES`

### Fields inherited from interface org.apache.lucene.util.Accountable

`NULL_ACCOUNTABLE`

## 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)`
`static LegacyDirectMonotonicReader`
`getInstance(LegacyDirectMonotonicReader.Meta meta, RandomAccessInput data)`
Retrieves an instance from the specified slice.
`static LegacyDirectMonotonicReader.Meta`
`loadMeta(IndexInput metaIn, long numValues, int blockShift)`
Load metadata from the given `IndexInput`.
`long`
`ramBytesUsed()`

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

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

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

`getChildResources`

## Method Details

### loadMeta

public static LegacyDirectMonotonicReader.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 LegacyDirectMonotonicReader getInstance(LegacyDirectMonotonicReader.Meta meta, RandomAccessInput data) throws IOException
Retrieves an instance from the specified slice.

Throws:
  `IOException`

### get

public long get(long 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)`

### ramBytesUsed

public long ramBytesUsed()

Specified by:
  `ramBytesUsed` in interface `Accountable`