Class TwoStepsMWHCFunction.Builder<T>
java.lang.Object
it.unimi.dsi.sux4j.mph.TwoStepsMWHCFunction.Builder<T>
- Enclosing class:
TwoStepsMWHCFunction<T>
A builder class for
TwoStepsMWHCFunction.- Since:
- 1.0.2
- Author:
- Sebastiano Vigna
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhetherbuild()has already been called.protected ChunkedHashStore<T> protected Fileprotected it.unimi.dsi.bits.TransformationStrategy<? super T> protected it.unimi.dsi.fastutil.longs.LongBigList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new function.Specifies the keys of the function; if you have specified ait.unimi.dsi.sux4j.io.ChunkedHashStore, it can benull.store(ChunkedHashStore<T> chunkedHashStore) Specifies a chunked hash store containing the keys associated with their rank.Specifies a temporary directory for theit.unimi.dsi.sux4j.io.ChunkedHashStore.Specifies the transformation strategy for the keys of the function.values(it.unimi.dsi.fastutil.longs.LongBigList values) Specifies the values assigned to the keys; the output width of the function will be the minimum width needed to represent all values.
-
Field Details
-
keys
-
transform
-
tempDir
-
chunkedHashStore
-
values
protected it.unimi.dsi.fastutil.longs.LongBigList values -
built
protected boolean builtWhetherbuild()has already been called.
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
keys
Specifies the keys of the function; if you have specified ait.unimi.dsi.sux4j.io.ChunkedHashStore, it can benull.- Parameters:
keys- the keys of the function.- Returns:
- this builder.
-
transform
public TwoStepsMWHCFunction.Builder<T> transform(it.unimi.dsi.bits.TransformationStrategy<? super T> transform) Specifies the transformation strategy for the keys of the function.- Parameters:
transform- a transformation strategy for the keys of the function.- Returns:
- this builder.
-
tempDir
Specifies a temporary directory for theit.unimi.dsi.sux4j.io.ChunkedHashStore.- Parameters:
tempDir- a temporary directory for theit.unimi.dsi.sux4j.io.ChunkedHashStorefiles, ornullfor the standard temporary directory.- Returns:
- this builder.
-
store
Specifies a chunked hash store containing the keys associated with their rank.Warning: during the construction phase, a filter will be set on the specified
ChunkedHashStore. You will have to reset it to its previous state.- Parameters:
chunkedHashStore- a chunked hash store containing the keys associated with their rank, 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.
-
values
-
build
Builds a new function.- Returns:
- an
MWHCFunctioninstance with the specified parameters. - Throws:
IllegalStateException- if called more than once.IOException
-