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()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableMultiPointArithmetic
. -
Field Summary
FieldsFields inherited from class net.bmahe.genetics4j.core.spec.combination.MultiPointArithmetic
DEFAULT_ALPHA
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ImmutableMultiPointArithmetic
(int numCrossovers, double alpha) private
-
Method Summary
Modifier and TypeMethodDescriptiondouble
alpha()
builder()
Creates a builder forImmutableMultiPointArithmetic
.copyOf
(MultiPointArithmetic instance) Creates an immutable copy of aMultiPointArithmetic
value.boolean
This instance is equal to all instances ofImmutableMultiPointArithmetic
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableMultiPointArithmetic another) int
hashCode()
Computes a hash code from attributes:numCrossovers
,alpha
.int
of
(int numCrossovers, double alpha) Construct a new immutableMultiPointArithmetic
instance.toString()
Prints the immutable valueMultiPointArithmetic
with attribute values.withAlpha
(double value) Copy the current immutable object by setting a value for thealpha
attribute.withNumCrossovers
(int value) Copy the current immutable object by setting a value for thenumCrossovers
attribute.Methods inherited from class net.bmahe.genetics4j.core.spec.combination.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:
numCrossovers
in classMultiPointArithmetic
- Returns:
- The value of the
numCrossovers
attribute
-
alpha
public double alpha()- Overrides:
alpha
in classMultiPointArithmetic
- Returns:
- The value of the
alpha
attribute
-
withNumCrossovers
Copy the current immutable object by setting a value for thenumCrossovers
attribute. 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 of the
this
object
-
withAlpha
Copy the current immutable object by setting a value for thealpha
attribute. 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 of the
this
object
-
equals
This instance is equal to all instances ofImmutableMultiPointArithmetic
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:numCrossovers
,alpha
. -
toString
Prints the immutable valueMultiPointArithmetic
with attribute values. -
of
Construct a new immutableMultiPointArithmetic
instance.- Parameters:
numCrossovers
- The value for thenumCrossovers
attributealpha
- The value for thealpha
attribute- Returns:
- An immutable MultiPointArithmetic instance
-
copyOf
Creates an immutable copy of aMultiPointArithmetic
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
Creates a builder forImmutableMultiPointArithmetic
.ImmutableMultiPointArithmetic.builder() .numCrossovers(int) // required
numCrossovers
.alpha(double) // optionalalpha
.build();- Returns:
- A new ImmutableMultiPointArithmetic builder
-