Class LegacyPacked64

    • Constructor Summary

      Constructors 
      Constructor Description
      LegacyPacked64​(int packedIntsVersion, DataInput in, int valueCount, int bitsPerValue)
      Creates an array with content retrieved from the given DataInput.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 ramBytesUsed()
      Return the memory usage of this object in bytes.
      int size()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • blocks

        private final long[] blocks
        Values are stores contiguously in the blocks array.
      • maskRight

        private final long maskRight
        A right-aligned mask of width BitsPerValue used by get(int).
      • bpvMinusBlockSize

        private final int bpvMinusBlockSize
        Optimization: Saves one lookup in get(int).
      • valueCount

        protected final int valueCount
        number of values
      • bitsPerValue

        protected final int bitsPerValue
        bits per value.
    • Constructor Detail

      • LegacyPacked64

        public LegacyPacked64​(int packedIntsVersion,
                              DataInput in,
                              int valueCount,
                              int bitsPerValue)
                       throws java.io.IOException
        Creates an array with content retrieved from the given DataInput.
        Parameters:
        in - a DataInput, positioned at the start of Packed64-content.
        valueCount - the number of elements.
        bitsPerValue - the number of bits available for any given value.
        Throws:
        java.io.IOException - if the values for the backing array could not be retrieved.
    • Method Detail

      • size

        public final int size()
        Specified by:
        size in class PackedInts.Reader
        Returns:
        the number of values.
      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • ramBytesUsed

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