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().

  • Field Details

  • Constructor Details

    • ImmutableNormalDistribution

      private ImmutableNormalDistribution(ImmutableNormalDistribution.Builder builder)
    • ImmutableNormalDistribution

      private ImmutableNormalDistribution(double mean, double standardDeviation)
  • Method Details

    • mean

      public double mean()
      Overrides:
      mean in class NormalDistribution
      Returns:
      The value of the mean attribute
    • standardDeviation

      public double standardDeviation()
      Overrides:
      standardDeviation in class NormalDistribution
      Returns:
      The value of the standardDeviation attribute
    • withMean

      public final ImmutableNormalDistribution withMean(double value)
      Copy the current immutable object by setting a value for the mean attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for mean
      Returns:
      A modified copy of the this object
    • withStandardDeviation

      public final ImmutableNormalDistribution withStandardDeviation(double value)
      Copy the current immutable object by setting a value for the standardDeviation attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for standardDeviation
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableNormalDistribution that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableNormalDistribution another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: mean, standardDeviation.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value NormalDistribution with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static ImmutableNormalDistribution of(double mean, double standardDeviation)
      Construct a new immutable NormalDistribution instance.
      Parameters:
      mean - The value for the mean attribute
      standardDeviation - The value for the standardDeviation attribute
      Returns:
      An immutable NormalDistribution instance
    • copyOf

      public static ImmutableNormalDistribution copyOf(NormalDistribution instance)
      Creates an immutable copy of a NormalDistribution 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

      public static ImmutableNormalDistribution.Builder builder()
      Creates a builder for ImmutableNormalDistribution.
       ImmutableNormalDistribution.builder()
          .mean(double) // optional mean
          .standardDeviation(double) // optional standardDeviation
          .build();
       
      Returns:
      A new ImmutableNormalDistribution builder