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(from="NormalDistribution",
generator="Immutables")
@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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeNormalDistribution.private final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleprivate static final byteprivate static final byteprivate static final byteprivate final double -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableNormalDistribution(double mean, double standardDeviation) private -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forNormalDistribution.static NormalDistributioncopyOf(NormalDistribution instance) Creates an immutable copy of aNormalDistributionvalue.booleanThis instance is equal to all instances ofImmutableNormalDistributionthat have equal attribute values.private booleanequalsByValue(ImmutableNormalDistribution another) inthashCode()Computes a hash code from attributes:mean,standardDeviation.doublemean()static NormalDistributionof(double mean, double standardDeviation) Construct a new immutableNormalDistributioninstance.doubletoString()Prints the immutable valueNormalDistributionwith attribute values.withMean(double value) Copy the current immutable object by setting a value for themeanattribute.withStandardDeviation(double value) Copy the current immutable object by setting a value for thestandardDeviationattribute.
-
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:
meanin classNormalDistribution- Returns:
- The value of the
meanattribute
-
standardDeviation
public double standardDeviation()- Overrides:
standardDeviationin classNormalDistribution- Returns:
- The value of the
standardDeviationattribute
-
withMean
Copy the current immutable object by setting a value for themeanattribute. 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 or the
thisobject
-
withStandardDeviation
Copy the current immutable object by setting a value for thestandardDeviationattribute. 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 or the
thisobject
-
equals
This instance is equal to all instances ofImmutableNormalDistributionthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:mean,standardDeviation. -
toString
Prints the immutable valueNormalDistributionwith attribute values. -
of
Construct a new immutableNormalDistributioninstance.- Parameters:
mean- The value for themeanattributestandardDeviation- The value for thestandardDeviationattribute- Returns:
- An immutable NormalDistribution instance
-
copyOf
Creates an immutable copy of aNormalDistributionvalue. 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 forNormalDistribution.ImmutableNormalDistribution.builder() .mean(double) // optionalmean.standardDeviation(double) // optionalstandardDeviation.build();- Returns:
- A new NormalDistribution builder
-