Class ImmutableMultiPointArithmetic

java.lang.Object
net.bmahe.genetics4j.core.spec.combination.MultiPointArithmetic
net.bmahe.genetics4j.core.spec.combination.ImmutableMultiPointArithmetic
All Implemented Interfaces:
CombinationPolicy

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableMultiPointArithmetic extends MultiPointArithmetic
Immutable implementation of MultiPointArithmetic.

Use the builder to create immutable instances: ImmutableMultiPointArithmetic.builder(). Use the static factory method to create immutable instances: ImmutableMultiPointArithmetic.of().

  • Field Details

    • numCrossovers

      private final int numCrossovers
    • alpha

      private final double alpha
  • Constructor Details

    • ImmutableMultiPointArithmetic

      private ImmutableMultiPointArithmetic(ImmutableMultiPointArithmetic.Builder builder)
    • ImmutableMultiPointArithmetic

      private ImmutableMultiPointArithmetic(int numCrossovers, double alpha)
  • Method Details

    • numCrossovers

      public int numCrossovers()
      Specified by:
      numCrossovers in class MultiPointArithmetic
      Returns:
      The value of the numCrossovers attribute
    • alpha

      public double alpha()
      Overrides:
      alpha in class MultiPointArithmetic
      Returns:
      The value of the alpha attribute
    • withNumCrossovers

      public final ImmutableMultiPointArithmetic withNumCrossovers(int value)
      Copy the current immutable object by setting a value for the numCrossovers attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for numCrossovers
      Returns:
      A modified copy of the this object
    • withAlpha

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableMultiPointArithmetic 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, ImmutableMultiPointArithmetic another)
    • hashCode

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

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

      public static ImmutableMultiPointArithmetic of(int numCrossovers, double alpha)
      Construct a new immutable MultiPointArithmetic instance.
      Parameters:
      numCrossovers - The value for the numCrossovers attribute
      alpha - The value for the alpha attribute
      Returns:
      An immutable MultiPointArithmetic instance
    • copyOf

      public static ImmutableMultiPointArithmetic copyOf(MultiPointArithmetic instance)
      Creates an immutable copy of a MultiPointArithmetic 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 MultiPointArithmetic instance
    • builder

      public static ImmutableMultiPointArithmetic.Builder builder()
      Creates a builder for ImmutableMultiPointArithmetic.
       ImmutableMultiPointArithmetic.builder()
          .numCrossovers(int) // required numCrossovers
          .alpha(double) // optional alpha
          .build();
       
      Returns:
      A new ImmutableMultiPointArithmetic builder