Klasse HashTableUtil
java.lang.Object
org.deidentifier.arx.framework.check.groupify.HashTableUtil
This class implements several helper methods for hash tables.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic final intcalculateCapacity(int x) Calculates a new capacity.static final intcalculateThreshold(int buckets, float loadFactor) Computes the threshold for rehashing.static final booleanequals(int[] a, int[] a2) Equality check for integer arrays.static final inthashcode(int[] array) Computes a hashcode for an integer array, partially unrolled.static final inthashcode_old(int[] array) Computes a hashcode for an integer array.static final voidnullifyArray(Object[] array) Returns the same result as Arrays.fill(array, null)
-
Konstruktordetails
-
HashTableUtil
public HashTableUtil()
-
-
Methodendetails
-
calculateCapacity
public static final int calculateCapacity(int x) Calculates a new capacity.- Parameter:
x- the parameter- Gibt zurück:
- the capacity
-
calculateThreshold
public static final int calculateThreshold(int buckets, float loadFactor) Computes the threshold for rehashing.- Parameter:
buckets-loadFactor-- Gibt zurück:
-
equals
public static final boolean equals(int[] a, int[] a2) Equality check for integer arrays.- Parameter:
a- an arraya2- another array- Gibt zurück:
- true, if equal
-
hashcode
public static final int hashcode(int[] array) Computes a hashcode for an integer array, partially unrolled.- Parameter:
array-- Gibt zurück:
- the hashcode
-
hashcode_old
public static final int hashcode_old(int[] array) Computes a hashcode for an integer array.- Parameter:
array- the array- Gibt zurück:
- the hashcode
-
nullifyArray
Returns the same result as Arrays.fill(array, null)- Parameter:
array- the array
-