Package it.unimi.dsi.sux4j.mph
Class LcpMonotoneMinimalPerfectHashFunction.Builder<T>
java.lang.Object
it.unimi.dsi.sux4j.mph.LcpMonotoneMinimalPerfectHashFunction.Builder<T>
- Enclosing class:
- LcpMonotoneMinimalPerfectHashFunction<T>
A builder class for
LcpMonotoneMinimalPerfectHashFunction
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds an LCP monotone minimal perfect hash function.Specifies the keys to hash.numKeys
(long numKeys) Specifies the number of keys.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
Specifies the keys to hash.- Parameters:
keys
- the keys to hash.- Returns:
- this builder.
-
numKeys
Specifies the number of keys.The argument must be equal to the number of keys returned by an iterator generated by
the set of keys
. Without this information, a first scan of the key set will be necessary to compute its cardinality, unless the set of keys implementsSize64
orCollection
.- Parameters:
numKeys
- the keys to hash.- Returns:
- this builder.
-
transform
public LcpMonotoneMinimalPerfectHashFunction.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 an LCP monotone minimal perfect hash function.- Returns:
- an
LcpMonotoneMinimalPerfectHashFunction
instance with the specified parameters. - Throws:
IllegalStateException
- if called more than once.IOException
-