Package it.unimi.dsi.sux4j.mph
Class ZFastTrieDistributorMonotoneMinimalPerfectHashFunction.Builder<T>
java.lang.Object
it.unimi.dsi.sux4j.mph.ZFastTrieDistributorMonotoneMinimalPerfectHashFunction.Builder<T>
- Enclosing class:
- ZFastTrieDistributorMonotoneMinimalPerfectHashFunction<T>
public static class ZFastTrieDistributorMonotoneMinimalPerfectHashFunction.Builder<T>
extends Object
A builder class for
ZFastTrieDistributorMonotoneMinimalPerfectHashFunction
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a monotone minimal perfect hash function based on a z-fast trie distributor.Specifies the keys to hash.signed
(int signatureWidth) Specifies that the resultingLcpMonotoneMinimalPerfectHashFunction
should be signed using a given number of bits per key.Specifies a temporary directory for theBucketedHashStore
.transform
(TransformationStrategy<? super T> transform) Specifies the transformation strategy for the keys to hash.
-
Field Details
-
keys
-
transform
-
numKeys
protected long numKeys -
signatureWidth
protected int signatureWidth -
tempDir
-
built
protected boolean builtWhetherbuild()
has already been called.
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
keys
public ZFastTrieDistributorMonotoneMinimalPerfectHashFunction.Builder<T> keys(Iterable<? extends T> keys) Specifies the keys to hash.- Parameters:
keys
- the keys to hash.- Returns:
- this builder.
-
transform
public ZFastTrieDistributorMonotoneMinimalPerfectHashFunction.Builder<T> transform(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 resultingLcpMonotoneMinimalPerfectHashFunction
should 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 theBucketedHashStore
. files, ornull
for the standard temporary directory.- Returns:
- this builder.
-
build
Builds a monotone minimal perfect hash function based on a z-fast trie distributor.- Returns:
- a
ZFastTrieDistributorMonotoneMinimalPerfectHashFunction
instance with the specified parameters. - Throws:
IllegalStateException
- if called more than once.IOException
-