Package it.unimi.dsi.sux4j.mph
Class TwoStepsGOV3Function.Builder<T>
java.lang.Object
it.unimi.dsi.sux4j.mph.TwoStepsGOV3Function.Builder<T>
- Enclosing class:
- TwoStepsGOV3Function<T>
A builder class for
TwoStepsGOV3Function
.-
Field Summary
Modifier and TypeFieldDescriptionprotected BucketedHashStore<T>
protected boolean
Whetherbuild()
has already been called.protected File
protected TransformationStrategy<? super T>
protected LongBigList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new function.Specifies the keys of the function; if you have specified aBucketedHashStore
, it can benull
.store
(BucketedHashStore<T> bucketedHashStore) Specifies a bucketed hash store containing the keys associated with their rank.Specifies a temporary directory for theBucketedHashStore
.transform
(TransformationStrategy<? super T> transform) Specifies the transformation strategy for the keys of the function.values
(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
-
bucketedHashStore
-
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 aBucketedHashStore
, it can benull
.- Parameters:
keys
- the keys of the function.- Returns:
- this builder.
-
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 theBucketedHashStore
.- Parameters:
tempDir
- a temporary directory for theBucketedHashStore
files, ornull
for the standard temporary directory.- Returns:
- this builder.
-
store
Specifies a bucketed hash store containing the keys associated with their rank.Warning: during the construction phase, a filter will be set on the specified
BucketedHashStore
. You will have to reset it to its previous state.- Parameters:
bucketedHashStore
- a bucketed 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 anIllegalStateException
will be thrown).- Returns:
- this builder.
-
values
Specifies the values assigned to the keys; the output width of the function will be the minimum width needed to represent all values.- Parameters:
values
- values to be assigned to each element, in the same order of the keys.- Returns:
- this builder.
-
build
Builds a new function.- Returns:
- a
GOV3Function
instance with the specified parameters. - Throws:
IllegalStateException
- if called more than once.IOException
-