Class ForDeltaUtil

java.lang.Object
org.apache.lucene.codecs.lucene99.ForDeltaUtil

public class ForDeltaUtil extends Object
Utility class to encode/decode increasing sequences of 128 integers.
  • Field Details

    • IDENTITY_PLUS_ONE

      private static final long[] IDENTITY_PLUS_ONE
    • forUtil

      private final ForUtil forUtil
  • Constructor Details

    • ForDeltaUtil

      ForDeltaUtil(ForUtil forUtil)
  • Method Details

    • prefixSumOfOnes

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

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

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