Class ZipfianIntegerGenerator.Builder
- Enclosing class:
ZipfianIntegerGenerator
Fluent builder for
ZipfianIntegerGenerator.- Since:
- 2.11.0
-
Field Summary
Fields inherited from class AbstractBuilder
DEFAULT_REFERENCE, random -
Constructor Summary
ConstructorsConstructorDescriptionBuilder(RandomGenerator random) Creates a builder backed by the given seeded random source. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a configured data generator.exponent(double exponent) The skew exponent;1.0is classic Zipf, higher concentrates more on the head.size(int size) The number of distinct values; required and must be>= 1.start(int start) The first (most frequent) value; ranks run[start, start + size).
-
Constructor Details
-
Builder
Creates a builder backed by the given seeded random source.- Parameters:
random- the random source used to draw generated values
-
-
Method Details
-
start
The first (most frequent) value; ranks run[start, start + size). Default1.- Parameters:
start- the lowest rank value- Returns:
- this builder, for chaining
-
size
The number of distinct values; required and must be>= 1.- Parameters:
size- the count of distinct ranks- Returns:
- this builder, for chaining
-
exponent
The skew exponent;1.0is classic Zipf, higher concentrates more on the head.- Parameters:
exponent- the skew exponent- Returns:
- this builder, for chaining
-
build
Description copied from interface:BuilderBuilds and returns a configured data generator.- Returns:
- a new
DataGeneratorconfigured with the builder's settings
-