org.deidentifier.arx.framework.check.groupify

## Class HashTableUtil

- java.lang.Object
- - org.deidentifier.arx.framework.check.groupify.HashTableUtil

    public class HashTableUtil
    extends java.lang.Object

This class implements several helper methods for hash tables.

Author:
  Fabian Prasser, Florian Kohlmayer

### Constructor Summary

Constructors
Constructor and Description
`HashTableUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static int` `calculateCapacity(int x)` Calculates a new capacity.
`static int` `calculateThreshold(int buckets, float loadFactor)` Computes the threshold for rehashing.
`static boolean` `equals(int[] a, int[] a2)` Equality check for integer arrays.
`static int` `hashcode_old(int[] array)` Computes a hashcode for an integer array.
`static int` `hashcode(int[] array)` Computes a hashcode for an integer array, partially unrolled.
`static void` `nullifyArray(java.lang.Object[] array)` Returns the same result as Arrays.fill(array, null)

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HashTableUtil

    public HashTableUtil()

### Method Detail

#### calculateCapacity

    public static final int calculateCapacity(int x)

Calculates a new capacity.

Parameters:
  `x` - the parameter
Returns:
  the capacity

#### calculateThreshold

    public static final int calculateThreshold(int buckets,
                                               float loadFactor)

Computes the threshold for rehashing.

Parameters:
  `buckets` -
  `loadFactor` -
Returns:

#### equals

    public static final boolean equals(int[] a,
                                       int[] a2)

Equality check for integer arrays.

Parameters:
  `a` - an array
  `a2` - another array
Returns:
  true, if equal

#### hashcode

    public static final int hashcode(int[] array)

Computes a hashcode for an integer array, partially unrolled.

Parameters:
  `array` -
Returns:
  the hashcode

#### hashcode_old

    public static final int hashcode_old(int[] array)

Computes a hashcode for an integer array.

Parameters:
  `array` - the array
Returns:
  the hashcode

#### nullifyArray

    public static final void nullifyArray(java.lang.Object[] array)

Returns the same result as Arrays.fill(array, null)

Parameters:
  `array` - the array