Module hash4j

Class DistinctCountUtil

java.lang.Object
com.dynatrace.hash4j.distinctcount.DistinctCountUtil

public final class DistinctCountUtil extends Object
A utility functions for distinct counting.
  • Method Details

    • deduplicateTokens

      public static int deduplicateTokens(int[] tokens, int fromIndexIncl, int toIndexExcl)
      Utility function for deduplicating hash tokens.

      The hash tokens in the given array with indices in the range [fromIndexIncl, toIndexExcl) are deduplicated. The resulting sorted and deduplicated hash tokens can finally be found at indices that are greater than or equal to fromIndexIncl and that are smaller than the returned value.

      Parameters:
      tokens - – the array of hash tokens to be deduplicated
      fromIndexIncl - the index of the first element, inclusive, to be deduplicated
      toIndexExcl - the index of the last element, exclusive, to be deduplicated
      Returns:
      the exclusive upper bound index of deduplicated hash values