Package it.unimi.dsi.sux4j.mph
Class TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T>
- java.lang.Object
-
- it.unimi.dsi.sux4j.mph.TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T>
-
- Enclosing class:
- TwoStepsLcpMonotoneMinimalPerfectHashFunction<T>
public static class TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T> extends java.lang.ObjectA builder class forTwoStepsLcpMonotoneMinimalPerfectHashFunction.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanbuiltWhetherbuild()has already been called.protected java.lang.Iterable<? extends T>keysprotected longnumKeysprotected intsignatureWidthprotected java.io.FiletempDirprotected it.unimi.dsi.bits.TransformationStrategy<? super T>transform
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TwoStepsLcpMonotoneMinimalPerfectHashFunction<T>build()Builds a two-steps LCP monotone minimal perfect hash function.TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T>keys(java.lang.Iterable<? extends T> keys)Specifies the keys to hash.TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T>numKeys(long numKeys)Specifies the number of keys.TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T>signed(int signatureWidth)Specifies that the resultingLcpMonotoneMinimalPerfectHashFunctionshould be signed using a given number of bits per key.TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T>tempDir(java.io.File tempDir)Specifies a temporary directory for theBucketedHashStore.TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T>transform(it.unimi.dsi.bits.TransformationStrategy<? super T> transform)Specifies the transformation strategy for the keys to hash.
-
-
-
Field Detail
-
keys
protected java.lang.Iterable<? extends T> keys
-
transform
protected it.unimi.dsi.bits.TransformationStrategy<? super T> transform
-
numKeys
protected long numKeys
-
signatureWidth
protected int signatureWidth
-
tempDir
protected java.io.File tempDir
-
built
protected boolean built
Whetherbuild()has already been called.
-
-
Method Detail
-
keys
public TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T> keys(java.lang.Iterable<? extends T> keys)
Specifies the keys to hash.- Parameters:
keys- the keys to hash.- Returns:
- this builder.
-
numKeys
public TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T> numKeys(long 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 implementsSize64orCollection.- Parameters:
numKeys- the keys to hash.- Returns:
- this builder.
-
transform
public TwoStepsLcpMonotoneMinimalPerfectHashFunction.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
public TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T> signed(int signatureWidth)
Specifies that the resultingLcpMonotoneMinimalPerfectHashFunctionshould be signed using a given number of bits per key.- Parameters:
signatureWidth- a signature width, or 0 for no signature.- Returns:
- this builder.
-
tempDir
public TwoStepsLcpMonotoneMinimalPerfectHashFunction.Builder<T> tempDir(java.io.File tempDir)
Specifies a temporary directory for theBucketedHashStore.- Parameters:
tempDir- a temporary directory for theBucketedHashStore. files, ornullfor the standard temporary directory.- Returns:
- this builder.
-
build
public TwoStepsLcpMonotoneMinimalPerfectHashFunction<T> build() throws java.io.IOException
Builds a two-steps LCP monotone minimal perfect hash function.- Returns:
- a
TwoStepsLcpMonotoneMinimalPerfectHashFunctioninstance with the specified parameters. - Throws:
java.lang.IllegalStateException- if called more than once.java.io.IOException
-
-