Class ForDeltaUtil


  • public class ForDeltaUtil
    extends java.lang.Object
    Utility class to encode/decode increasing sequences of 128 integers.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void decodeAndPrefixSum​(DataInput in, long base, long[] longs)
      Decode deltas, compute the prefix sum and add base to all decoded longs.
      (package private) void encodeDeltas​(long[] longs, DataOutput out)
      Encode deltas of a strictly monotonically increasing sequence of integers.
      private static void prefixSumOfOnes​(long[] arr, long base)  
      • Methods inherited from class java.lang.Object

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

      • IDENTITY_PLUS_ONE

        private static final long[] IDENTITY_PLUS_ONE
      • forUtil

        private final ForUtil forUtil
    • Constructor Detail

      • ForDeltaUtil

        ForDeltaUtil​(ForUtil forUtil)
    • Method Detail

      • prefixSumOfOnes

        private static void prefixSumOfOnes​(long[] arr,
                                            long base)
      • encodeDeltas

        void encodeDeltas​(long[] longs,
                          DataOutput out)
                   throws java.io.IOException
        Encode deltas of a strictly monotonically increasing sequence of integers. The provided longs are expected to be deltas between consecutive values.
        Throws:
        java.io.IOException
      • decodeAndPrefixSum

        void decodeAndPrefixSum​(DataInput in,
                                long base,
                                long[] longs)
                         throws java.io.IOException
        Decode deltas, compute the prefix sum and add base to all decoded longs.
        Throws:
        java.io.IOException