Class NormalDoubleGenerator
- All Implemented Interfaces:
DataGenerator<Double>
Generates
double values from a normal (Gaussian) distribution with the configured
mean and standard deviation, clamped to the inclusive range [min, max]. Useful when a
numeric column should cluster around a central value rather than spread uniformly (prices, scores,
measurements).
Clamping (rather than re-drawing) keeps generation O(1) and reproducible; values beyond the
bounds pile up slightly at min/max, so choose a range a few standard deviations wide
to keep that mass negligible.
- Since:
- 2.11.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilds aNormalDoubleGenerator, defaulting to a standard normal distribution (mean 0, standard deviation 1) with effectively unboundedmin/max. -
Field Summary
Fields inherited from class AbstractDataGenerator
random, randomUtils -
Method Summary
Modifier and TypeMethodDescriptiongenerate()Generates a random value of type T.Retrieves a value from a ResultSet column.voidset(Connection connection, PreparedStatement statement, int parameterIndex, Double value) Sets a specific value on a PreparedStatement parameter.Methods inherited from class AbstractDataGenerator
generateAndSet, generateAsString, reseed
-
Method Details
-
generate
Description copied from interface:DataGeneratorGenerates a random value of type T.- Returns:
- a generated value, may be null if the generator supports nullable columns
-
set
public void set(Connection connection, PreparedStatement statement, int parameterIndex, Double value) throws SQLException Description copied from interface:DataGeneratorSets a specific value on a PreparedStatement parameter.- Specified by:
setin interfaceDataGenerator<Double>- Overrides:
setin classAbstractDataGenerator<Double>- Parameters:
connection- the database connectionstatement- the prepared statement to set the parameter onparameterIndex- the 1-based parameter indexvalue- the value to set- Throws:
SQLException- if the database operation fails
-
get
Description copied from interface:DataGeneratorRetrieves a value from a ResultSet column.- Parameters:
resultSet- the result set to read fromcolumnIndex- the 1-based column index- Returns:
- the value from the result set, properly cast to type T
- Throws:
SQLException- if the database operation fails
-