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>
public static class TwoStepsGOV3Function.Builder<T> extends java.lang.ObjectA builder class forTwoStepsGOV3Function.
-
-
Field Summary
Fields Modifier and Type Field Description protected BucketedHashStore<T>bucketedHashStoreprotected booleanbuiltWhetherbuild()has already been called.protected java.lang.Iterable<? extends T>keysprotected java.io.FiletempDirprotected it.unimi.dsi.bits.TransformationStrategy<? super T>transformprotected it.unimi.dsi.fastutil.longs.LongBigListvalues
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TwoStepsGOV3Function<T>build()Builds a new function.TwoStepsGOV3Function.Builder<T>keys(java.lang.Iterable<? extends T> keys)Specifies the keys of the function; if you have specified aBucketedHashStore, it can benull.TwoStepsGOV3Function.Builder<T>store(BucketedHashStore<T> bucketedHashStore)Specifies a bucketed hash store containing the keys associated with their rank.TwoStepsGOV3Function.Builder<T>tempDir(java.io.File tempDir)Specifies a temporary directory for theBucketedHashStore.TwoStepsGOV3Function.Builder<T>transform(it.unimi.dsi.bits.TransformationStrategy<? super T> transform)Specifies the transformation strategy for the keys of the function.TwoStepsGOV3Function.Builder<T>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 Detail
-
keys
protected java.lang.Iterable<? extends T> keys
-
transform
protected it.unimi.dsi.bits.TransformationStrategy<? super T> transform
-
tempDir
protected java.io.File tempDir
-
bucketedHashStore
protected BucketedHashStore<T> bucketedHashStore
-
values
protected it.unimi.dsi.fastutil.longs.LongBigList values
-
built
protected boolean built
Whetherbuild()has already been called.
-
-
Method Detail
-
keys
public TwoStepsGOV3Function.Builder<T> keys(java.lang.Iterable<? extends T> 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
public TwoStepsGOV3Function.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
public TwoStepsGOV3Function.Builder<T> tempDir(java.io.File tempDir)
Specifies a temporary directory for theBucketedHashStore.- Parameters:
tempDir- a temporary directory for theBucketedHashStorefiles, ornullfor the standard temporary directory.- Returns:
- this builder.
-
store
public TwoStepsGOV3Function.Builder<T> store(BucketedHashStore<T> bucketedHashStore)
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 anIllegalStateExceptionwill be thrown).- Returns:
- this builder.
-
values
public TwoStepsGOV3Function.Builder<T> 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.- Parameters:
values- values to be assigned to each element, in the same order of the keys.- Returns:
- this builder.
-
build
public TwoStepsGOV3Function<T> build() throws java.io.IOException
Builds a new function.- Returns:
- a
GOV3Functioninstance with the specified parameters. - Throws:
java.lang.IllegalStateException- if called more than once.java.io.IOException
-
-