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

Package org.apache.lucene.util.packed

# Class PackedLongValues

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

All Implemented Interfaces:
  `Accountable`

public class PackedLongValues extends LongValues implements Accountable
Utility class to compress integers into a `LongValues` instance.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `PackedLongValues.Builder`
  A Builder for a `PackedLongValues` instance.
  `final class`
  `PackedLongValues.Iterator`
  An iterator over long values.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_PAGE_SIZE`

  ### 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
  `static PackedLongValues.Builder`
  `deltaPackedBuilder(float acceptableOverheadRatio)`
  `static PackedLongValues.Builder`
  `deltaPackedBuilder(int pageSize, float acceptableOverheadRatio)`
  Return a new `PackedLongValues.Builder` that will compress efficiently integers that are close to each other.
  `final long`
  `get(long index)`
  Get value at `index`.
  `PackedLongValues.Iterator`
  `iterator()`
  Return an iterator over the values of this array.
  `static PackedLongValues.Builder`
  `monotonicBuilder(float acceptableOverheadRatio)`
  `static PackedLongValues.Builder`
  `monotonicBuilder(int pageSize, float acceptableOverheadRatio)`
  Return a new `PackedLongValues.Builder` that will compress efficiently integers that would be a monotonic function of their index.
  `static PackedLongValues.Builder`
  `packedBuilder(float acceptableOverheadRatio)`
  `static PackedLongValues.Builder`
  `packedBuilder(int pageSize, float acceptableOverheadRatio)`
  Return a new `PackedLongValues.Builder` that will compress efficiently positive integers.
  `long`
  `ramBytesUsed()`
  Returns an estimate of the JVM heap memory used by this object in bytes.
  `final long`
  `size()`
  Get the number of values in this array.

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

- ## Field Details

  - ### DEFAULT_PAGE_SIZE

    public static final int DEFAULT_PAGE_SIZE
    See Also:
      - Constant Field Values

- ## Method Details

  - ### packedBuilder

    public static PackedLongValues.Builder packedBuilder(int pageSize, float acceptableOverheadRatio)
    Return a new `PackedLongValues.Builder` that will compress efficiently positive integers.

  - ### packedBuilder

    public static PackedLongValues.Builder packedBuilder(float acceptableOverheadRatio)
    See Also:
      - `packedBuilder(int, float)`

  - ### deltaPackedBuilder

    public static PackedLongValues.Builder deltaPackedBuilder(int pageSize, float acceptableOverheadRatio)
    Return a new `PackedLongValues.Builder` that will compress efficiently integers that are close to each other.

  - ### deltaPackedBuilder

    public static PackedLongValues.Builder deltaPackedBuilder(float acceptableOverheadRatio)
    See Also:
      - `deltaPackedBuilder(int, float)`

  - ### monotonicBuilder

    public static PackedLongValues.Builder monotonicBuilder(int pageSize, float acceptableOverheadRatio)
    Return a new `PackedLongValues.Builder` that will compress efficiently integers that would be a monotonic function of their index.

  - ### monotonicBuilder

    public static PackedLongValues.Builder monotonicBuilder(float acceptableOverheadRatio)
    See Also:
      - `monotonicBuilder(int, float)`

  - ### size

    public final long size()
    Get the number of values in this array.

  - ### get

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

  - ### ramBytesUsed

    public long ramBytesUsed()
    Description copied from interface: `Accountable`
    Returns an estimate of the JVM heap memory used by this object in bytes. The method name uses "ram" for historical reasons; only JVM heap memory should be reported. Off-heap resources such as memory-mapped files or native direct buffers should not be included. Negative values are illegal.
    Specified by:
      `ramBytesUsed` in interface `Accountable`

  - ### iterator

    public PackedLongValues.Iterator iterator()
    Return an iterator over the values of this array.