Class ImmutableNormalDistribution
java.lang.Object
net.bmahe.genetics4j.core.spec.statistics.distributions.NormalDistribution
net.bmahe.genetics4j.core.spec.statistics.distributions.ImmutableNormalDistribution
- All Implemented Interfaces:
Distribution
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableNormalDistribution
extends NormalDistribution
Immutable implementation of
NormalDistribution
.
Use the builder to create immutable instances:
ImmutableNormalDistribution.builder()
.
Use the static factory method to create immutable instances:
ImmutableNormalDistribution.of()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableNormalDistribution
.private final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final double
private static final byte
private static final byte
private static final byte
private final double
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableNormalDistribution
(double mean, double standardDeviation) private
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableNormalDistribution
.static ImmutableNormalDistribution
copyOf
(NormalDistribution instance) Creates an immutable copy of aNormalDistribution
value.boolean
This instance is equal to all instances ofImmutableNormalDistribution
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableNormalDistribution another) int
hashCode()
Computes a hash code from attributes:mean
,standardDeviation
.double
mean()
static ImmutableNormalDistribution
of
(double mean, double standardDeviation) Construct a new immutableNormalDistribution
instance.double
toString()
Prints the immutable valueNormalDistribution
with attribute values.withMean
(double value) Copy the current immutable object by setting a value for themean
attribute.withStandardDeviation
(double value) Copy the current immutable object by setting a value for thestandardDeviation
attribute.
-
Field Details
-
mean
private final double mean -
standardDeviation
private final double standardDeviation -
STAGE_INITIALIZING
private static final byte STAGE_INITIALIZING- See Also:
-
STAGE_UNINITIALIZED
private static final byte STAGE_UNINITIALIZED- See Also:
-
STAGE_INITIALIZED
private static final byte STAGE_INITIALIZED- See Also:
-
initShim
-
-
Constructor Details
-
ImmutableNormalDistribution
-
ImmutableNormalDistribution
private ImmutableNormalDistribution(double mean, double standardDeviation)
-
-
Method Details
-
mean
public double mean()- Overrides:
mean
in classNormalDistribution
- Returns:
- The value of the
mean
attribute
-
standardDeviation
public double standardDeviation()- Overrides:
standardDeviation
in classNormalDistribution
- Returns:
- The value of the
standardDeviation
attribute
-
withMean
Copy the current immutable object by setting a value for themean
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for mean- Returns:
- A modified copy of the
this
object
-
withStandardDeviation
Copy the current immutable object by setting a value for thestandardDeviation
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for standardDeviation- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableNormalDistribution
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:mean
,standardDeviation
. -
toString
Prints the immutable valueNormalDistribution
with attribute values. -
of
Construct a new immutableNormalDistribution
instance.- Parameters:
mean
- The value for themean
attributestandardDeviation
- The value for thestandardDeviation
attribute- Returns:
- An immutable NormalDistribution instance
-
copyOf
Creates an immutable copy of aNormalDistribution
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable NormalDistribution instance
-
builder
Creates a builder forImmutableNormalDistribution
.ImmutableNormalDistribution.builder() .mean(double) // optional
mean
.standardDeviation(double) // optionalstandardDeviation
.build();- Returns:
- A new ImmutableNormalDistribution builder
-