Class Packed16ThreeBlocks

All Implemented Interfaces:
Accountable

final class Packed16ThreeBlocks extends PackedInts.MutableImpl
Packs integers into 3 shorts (48 bits per value).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final short[]
     
    static final int
     

    Fields inherited from class org.apache.lucene.util.packed.PackedInts.MutableImpl

    bitsPerValue, valueCount

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

    NULL_ACCOUNTABLE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Packed16ThreeBlocks(int valueCount)
     
    Packed16ThreeBlocks(int packedIntsVersion, DataInput in, int valueCount)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets all values to 0.
    void
    fill(int fromIndex, int toIndex, long val)
    Fill the mutable from fromIndex (inclusive) to toIndex (exclusive) with val.
    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.
    long
    Return the memory usage of this object in bytes.
    void
    set(int index, long value)
    Set the value at the given index in the array.
    int
    set(int index, long[] arr, int off, int len)
    Bulk set: set at least one and at most len longs starting at off in arr into this mutable, starting at index.
     

    Methods inherited from class org.apache.lucene.util.packed.PackedInts.MutableImpl

    getBitsPerValue, size

    Methods inherited from class org.apache.lucene.util.packed.PackedInts.Mutable

    getFormat, save

    Methods inherited from class java.lang.Object

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

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

    getChildResources
  • Field Details

    • blocks

      final short[] blocks
    • MAX_SIZE

      public static final int MAX_SIZE
      See Also:
  • Constructor Details

    • Packed16ThreeBlocks

      Packed16ThreeBlocks(int valueCount)
    • Packed16ThreeBlocks

      Packed16ThreeBlocks(int packedIntsVersion, DataInput in, int valueCount) throws IOException
      Throws:
      IOException
  • Method Details

    • get

      public long get(int index)
      Description copied from class: PackedInts.Reader
      Get the long at the given index. Behavior is undefined for out-of-range indices.
      Specified by:
      get in class PackedInts.Reader
    • get

      public int get(int index, long[] arr, int off, int len)
      Description copied from class: PackedInts.Reader
      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.
      Overrides:
      get in class PackedInts.Reader
    • set

      public void set(int index, long value)
      Description copied from class: PackedInts.Mutable
      Set the value at the given index in the array.
      Specified by:
      set in class PackedInts.Mutable
      Parameters:
      index - where the value should be positioned.
      value - a value conforming to the constraints set by the array.
    • set

      public int set(int index, long[] arr, int off, int len)
      Description copied from class: PackedInts.Mutable
      Bulk set: set at least one and at most len longs starting at off in arr into this mutable, starting at index. Returns the actual number of values that have been set.
      Overrides:
      set in class PackedInts.Mutable
    • fill

      public void fill(int fromIndex, int toIndex, long val)
      Description copied from class: PackedInts.Mutable
      Fill the mutable from fromIndex (inclusive) to toIndex (exclusive) with val.
      Overrides:
      fill in class PackedInts.Mutable
    • clear

      public void clear()
      Description copied from class: PackedInts.Mutable
      Sets all values to 0.
      Overrides:
      clear in class PackedInts.Mutable
    • ramBytesUsed

      public long ramBytesUsed()
      Description copied from interface: Accountable
      Return the memory usage of this object in bytes. Negative values are illegal.
    • toString

      public String toString()
      Overrides:
      toString in class PackedInts.MutableImpl