Package de.gsi.dataset.spi.utils
Class HashMapHelper
- java.lang.Object
-
- de.gsi.dataset.spi.utils.HashMapHelper
-
public final class HashMapHelper extends java.lang.ObjectCommon HashMap methods taken from FastUtil implementation
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intarraySize(int expected, float f)Returns the least power of two smaller than or equal to 230 and larger than or equal toMath.ceil( expected / f ).static longnextPowerOfTwo(long length)Return the least power of two greater than or equal to the specified value.static intphiMix(int x)
-
-
-
Method Detail
-
arraySize
public static int arraySize(int expected, float f)Returns the least power of two smaller than or equal to 230 and larger than or equal toMath.ceil( expected / f ).- Parameters:
expected- the expected number of elements in a hash table.f- the load factor.- Returns:
- the minimum possible size for a backing array.
- Throws:
java.lang.IllegalArgumentException- if the necessary size is larger than 230.
-
nextPowerOfTwo
public static long nextPowerOfTwo(long length)
Return the least power of two greater than or equal to the specified value.Note that this function will return 1 when the argument is 0.
- Parameters:
length- a long integer smaller than or equal to 262.- Returns:
- the least power of two greater than or equal to the specified value.
-
phiMix
public static int phiMix(int x)
-
-