Class ImmutableMultiPointArithmetic
java.lang.Object
net.bmahe.genetics4j.core.spec.combination.MultiPointArithmetic
net.bmahe.genetics4j.core.spec.combination.ImmutableMultiPointArithmetic
- All Implemented Interfaces:
CombinationPolicy
@Generated(from="MultiPointArithmetic",
generator="Immutables")
@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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeMultiPointArithmetic. -
Field Summary
FieldsFields inherited from class MultiPointArithmetic
DEFAULT_ALPHA -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableMultiPointArithmetic(int numCrossovers, double alpha) private -
Method Summary
Modifier and TypeMethodDescriptiondoublealpha()builder()Creates a builder forMultiPointArithmetic.static MultiPointArithmeticcopyOf(MultiPointArithmetic instance) Creates an immutable copy of aMultiPointArithmeticvalue.booleanThis instance is equal to all instances ofImmutableMultiPointArithmeticthat have equal attribute values.private booleaninthashCode()Computes a hash code from attributes:numCrossovers,alpha.intstatic MultiPointArithmeticof(int numCrossovers, double alpha) Construct a new immutableMultiPointArithmeticinstance.toString()Prints the immutable valueMultiPointArithmeticwith attribute values.withAlpha(double value) Copy the current immutable object by setting a value for thealphaattribute.withNumCrossovers(int value) Copy the current immutable object by setting a value for thenumCrossoversattribute.Methods inherited from class MultiPointArithmetic
of
-
Field Details
-
numCrossovers
private final int numCrossovers -
alpha
private final double alpha
-
-
Constructor Details
-
ImmutableMultiPointArithmetic
-
ImmutableMultiPointArithmetic
private ImmutableMultiPointArithmetic(int numCrossovers, double alpha)
-
-
Method Details
-
numCrossovers
public int numCrossovers()- Specified by:
numCrossoversin classMultiPointArithmetic- Returns:
- The value of the
numCrossoversattribute
-
alpha
public double alpha()- Overrides:
alphain classMultiPointArithmetic- Returns:
- The value of the
alphaattribute
-
withNumCrossovers
Copy the current immutable object by setting a value for thenumCrossoversattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for numCrossovers- Returns:
- A modified copy or the
thisobject
-
withAlpha
Copy the current immutable object by setting a value for thealphaattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for alpha- Returns:
- A modified copy or the
thisobject
-
equals
-
equalsByValue
-
hashCode
-
toString
-
of
Construct a new immutableMultiPointArithmeticinstance.- Parameters:
numCrossovers- The value for thenumCrossoversattributealpha- The value for thealphaattribute- Returns:
- An immutable MultiPointArithmetic instance
-
copyOf
Creates an immutable copy of aMultiPointArithmeticvalue. 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
Creates a builder forMultiPointArithmetic.ImmutableMultiPointArithmetic.builder() .numCrossovers(int) // required
numCrossovers.alpha(double) // optionalalpha.build();- Returns:
- A new MultiPointArithmetic builder
-