Class PackedInts.Reader

java.lang.Object
org.apache.lucene.index.NumericDocValues
org.apache.lucene.util.packed.PackedInts.Reader
Direct Known Subclasses:
PackedInts.Mutable, PackedInts.NullReader
Enclosing class:
PackedInts

public abstract static class PackedInts.Reader extends NumericDocValues
A read-only random access array of positive integers.
  • Field Summary

    Fields inherited from class org.apache.lucene.index.NumericDocValues

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    Expert: if the bit-width of this reader matches one of java's native types, returns the underlying array (ie, byte[], short[], int[], long[]); else, returns null.
    abstract int
     
    boolean
    Returns true if this implementation is backed by a native java array.
    abstract long
    Return the in-memory size in bytes.
    abstract int
     

    Methods inherited from class org.apache.lucene.index.NumericDocValues

    get

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Reader

      public Reader()
  • Method Details

    • 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.
    • getBitsPerValue

      public abstract int getBitsPerValue()
      Returns:
      the number of bits used to store any given value. Note: This does not imply that memory usage is bitsPerValue * #values as implementations are free to use non-space-optimal packing of bits.
    • size

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

      public abstract long ramBytesUsed()
      Return the in-memory size in bytes.
    • getArray

      public Object getArray()
      Expert: if the bit-width of this reader matches one of java's native types, returns the underlying array (ie, byte[], short[], int[], long[]); else, returns null. Note that when accessing the array you must upgrade the type (bitwise AND with all ones), to interpret the full value as unsigned. Ie, bytes[idx]&0xFF, shorts[idx]&0xFFFF, etc.
    • hasArray

      public boolean hasArray()
      Returns true if this implementation is backed by a native java array.
      See Also: