Package com.apple.foundationdb.async
Class RankedSet.ConfigBuilder
- java.lang.Object
-
- com.apple.foundationdb.async.RankedSet.ConfigBuilder
-
- Enclosing class:
- RankedSet
public static class RankedSet.ConfigBuilder extends Object
Builder forRankedSet.Config
.- See Also:
RankedSet.newConfigBuilder()
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConfigBuilder()
protected
ConfigBuilder(RankedSet.HashFunction hashFunction, int nlevels, boolean countDuplicates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RankedSet.Config
build()
RankedSet.HashFunction
getHashFunction()
int
getNLevels()
boolean
isCountDuplicates()
RankedSet.ConfigBuilder
setCountDuplicates(boolean countDuplicates)
Set whether to count duplicate keys separately.RankedSet.ConfigBuilder
setHashFunction(RankedSet.HashFunction hashFunction)
Set the hash function to use.RankedSet.ConfigBuilder
setNLevels(int nlevels)
Set the hash function to use.
-
-
-
Constructor Detail
-
ConfigBuilder
protected ConfigBuilder()
-
ConfigBuilder
protected ConfigBuilder(RankedSet.HashFunction hashFunction, int nlevels, boolean countDuplicates)
-
-
Method Detail
-
getHashFunction
public RankedSet.HashFunction getHashFunction()
-
setHashFunction
public RankedSet.ConfigBuilder setHashFunction(RankedSet.HashFunction hashFunction)
Set the hash function to use. It is possible to change the hash function of an existing ranked set, although this is not recommended since the distribution in the skip list may become uneven as a result.- Parameters:
hashFunction
- the hash function to use- Returns:
- this builder
-
getNLevels
public int getNLevels()
-
setNLevels
public RankedSet.ConfigBuilder setNLevels(int nlevels)
Set the hash function to use. It is not currently possible to change the number of levels for an existing ranked set.- Parameters:
nlevels
- the number of levels to use- Returns:
- this builder
-
isCountDuplicates
public boolean isCountDuplicates()
-
setCountDuplicates
public RankedSet.ConfigBuilder setCountDuplicates(boolean countDuplicates)
Set whether to count duplicate keys separately. If duplicate keys are counted separately, ranks after them are increased by the number of duplicates.- Parameters:
countDuplicates
- whether to count duplicates- Returns:
- this builder
-
build
public RankedSet.Config build()
-
-