PackedInts.Reader (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.util.packed, class: PackedInts, class: Reader

Package org.apache.lucene.util.packed

# Class PackedInts.Reader

java.lang.Object
org.apache.lucene.util.packed.PackedInts.Reader

All Implemented Interfaces:
  `Accountable`

Direct Known Subclasses:
  `PackedInts.Mutable`, `PackedInts.NullReader`

Enclosing class:
  `PackedInts`

public abstract static class PackedInts.Reader extends Object implements Accountable
A read-only random access array of positive integers.

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

- ## Field Summary

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

  `NULL_ACCOUNTABLE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Reader()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract long`
  `get(int index)`
  Get the long at the given index.
  `int`
  `get(int index, long[] arr, int off, int len)`
  Bulk get: read at least one and at most `len` longs starting from `index` into `arr[off:off+len]` and return the actual number of values that have been read.
  `abstract int`
  `size()`

  ### 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, ramBytesUsed`

- ## Constructor Details

  - ### Reader

    public Reader()

- ## Method Details

  - ### get

    public abstract long get(int index)
    Get the long at the given index. Behavior is undefined for out-of-range indices.

  - ### get

    public int get(int index, long[] arr, int off, int len)
    Bulk get: read at least one and at most `len` longs starting from `index` into `arr[off:off+len]` and return the actual number of values that have been read.

  - ### size

    public abstract int size()
    Returns:
      the number of values.