Class GOVMinimalPerfectHashFunction128.Builder<T>
java.lang.Object
it.unimi.dsi.sux4j.test.GOVMinimalPerfectHashFunction128.Builder<T>
- Enclosing class:
GOVMinimalPerfectHashFunction128<T>
A builder class for
GOVMinimalPerfectHashFunction128.- Since:
- 4.0.0
- Author:
- Sebastiano Vigna
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BucketedHashStore<T> protected booleanWhetherbuild()has already been called.protected intprotected Fileprotected it.unimi.dsi.bits.TransformationStrategy<? super T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a minimal perfect hash function.Specifies the keys to hash; if you have specified aBucketedHashStore, it can benull.signed(int signatureWidth) Specifies that the resultingGOVMinimalPerfectHashFunction128should be signed using a given number of bits per key.store(BucketedHashStore<T> bucketedHashStore) Specifies a bucketed hash store containing the keys.Specifies a temporary directory for theBucketedHashStore.Specifies the transformation strategy for the keys to hash.
-
Field Details
-
keys
-
transform
-
signatureWidth
protected int signatureWidth -
tempDir
-
bucketedHashStore
-
built
protected boolean builtWhetherbuild()has already been called.
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
keys
Specifies the keys to hash; if you have specified aBucketedHashStore, it can benull.- Parameters:
keys- the keys to hash.- Returns:
- this builder.
-
transform
public GOVMinimalPerfectHashFunction128.Builder<T> transform(it.unimi.dsi.bits.TransformationStrategy<? super T> transform) Specifies the transformation strategy for the keys to hash.- Parameters:
transform- a transformation strategy for the keys to hash.- Returns:
- this builder.
-
signed
Specifies that the resultingGOVMinimalPerfectHashFunction128should be signed using a given number of bits per key.- Parameters:
signatureWidth- a signature width, or 0 for no signature.- Returns:
- this builder.
-
tempDir
Specifies a temporary directory for theBucketedHashStore.- Parameters:
tempDir- a temporary directory for theBucketedHashStorefiles, ornullfor the standard temporary directory.- Returns:
- this builder.
-
store
Specifies a bucketed hash store containing the keys.- Parameters:
bucketedHashStore- a bucketed hash store containing the keys, ornull; the store can be unchecked, but in this case you must specify keys and a transform (otherwise, in case of a hash collision in the store anIllegalStateExceptionwill be thrown).- Returns:
- this builder.
-
build
Builds a minimal perfect hash function.- Returns:
- a
GOVMinimalPerfectHashFunction128instance with the specified parameters. - Throws:
IllegalStateException- if called more than once.IOException
-