Package org.h2.dev.hash
Class IntPerfectHash
- java.lang.Object
-
- org.h2.dev.hash.IntPerfectHash
-
public class IntPerfectHash extends java.lang.ObjectA minimum perfect hash function tool. It needs about 2.2 bits per key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIntPerfectHash.BitArrayA helper class for bit arrays.
-
Constructor Summary
Constructors Constructor Description IntPerfectHash(byte[] data)Create a hash object to convert keys to hashes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]generate(java.util.ArrayList<java.lang.Integer> list)Generate the minimal perfect hash function data from the given list.intget(int x)Calculate the hash value for the given key.byte[]getData()Get the hash function description.
-
-
-
Method Detail
-
getData
public byte[] getData()
Get the hash function description.- Returns:
- the data
-
get
public int get(int x)
Calculate the hash value for the given key.- Parameters:
x- the key- Returns:
- the hash value
-
generate
public static byte[] generate(java.util.ArrayList<java.lang.Integer> list)
Generate the minimal perfect hash function data from the given list.- Parameters:
list- the data- Returns:
- the hash function description
-
-