Class ImmutableGenerationalReplacement
java.lang.Object
net.bmahe.genetics4j.core.spec.replacement.ImmutableGenerationalReplacement
- All Implemented Interfaces:
GenerationalReplacement
,ReplacementStrategy
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableGenerationalReplacement
extends Object
implements GenerationalReplacement
Immutable implementation of
GenerationalReplacement
.
Use the builder to create immutable instances:
new GenerationalReplacement.Builder()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builds instances of typeImmutableGenerationalReplacement
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableGenerationalReplacement
(SelectionPolicy offspringSelectionPolicy) -
Method Summary
Modifier and TypeMethodDescriptioncopyOf
(GenerationalReplacement instance) Creates an immutable copy of aGenerationalReplacement
value.boolean
This instance is equal to all instances ofImmutableGenerationalReplacement
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableGenerationalReplacement another) int
hashCode()
Computes a hash code from attributes:offspringSelectionPolicy
.toString()
Prints the immutable valueGenerationalReplacement
with attribute values.Copy the current immutable object by setting a value for theoffspringSelectionPolicy
attribute.
-
Field Details
-
offspringSelectionPolicy
-
-
Constructor Details
-
ImmutableGenerationalReplacement
-
-
Method Details
-
offspringSelectionPolicy
- Specified by:
offspringSelectionPolicy
in interfaceGenerationalReplacement
- Returns:
- The value of the
offspringSelectionPolicy
attribute
-
withOffspringSelectionPolicy
Copy the current immutable object by setting a value for theoffspringSelectionPolicy
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for offspringSelectionPolicy- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableGenerationalReplacement
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:offspringSelectionPolicy
. -
toString
Prints the immutable valueGenerationalReplacement
with attribute values. -
copyOf
Creates an immutable copy of aGenerationalReplacement
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 GenerationalReplacement instance
-