Class ImmutableProgramRandomPrune
java.lang.Object
net.bmahe.genetics4j.gp.spec.mutation.ImmutableProgramRandomPrune
- All Implemented Interfaces:
MutationPolicy,ProgramRandomPrune
@Generated(from="ProgramRandomPrune",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableProgramRandomPrune
extends Object
implements ProgramRandomPrune
Immutable implementation of
ProgramRandomPrune.
Use the builder to create immutable instances:
ImmutableProgramRandomPrune.builder().
Use the static factory method to create immutable instances:
ImmutableProgramRandomPrune.of().
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableProgramRandomPrune(double populationMutationProbability) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forProgramRandomPrune.static ProgramRandomPrunecopyOf(ProgramRandomPrune instance) Creates an immutable copy of aProgramRandomPrunevalue.booleanThis instance is equal to all instances ofImmutableProgramRandomPrunethat have equal attribute values.private booleanequalsByValue(ImmutableProgramRandomPrune another) inthashCode()Computes a hash code from attributes:populationMutationProbability.static ProgramRandomPruneof(double populationMutationProbability) Construct a new immutableProgramRandomPruneinstance.doubletoString()Prints the immutable valueProgramRandomPrunewith attribute values.private static ImmutableProgramRandomPrunevalidate(ImmutableProgramRandomPrune instance) withPopulationMutationProbability(double value) Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.bmahe.genetics4j.gp.spec.mutation.ProgramRandomPrune
check
-
Field Details
-
populationMutationProbability
private final double populationMutationProbability
-
-
Constructor Details
-
ImmutableProgramRandomPrune
private ImmutableProgramRandomPrune(double populationMutationProbability)
-
-
Method Details
-
populationMutationProbability
public double populationMutationProbability()- Specified by:
populationMutationProbabilityin interfaceProgramRandomPrune- Returns:
- The value of the
populationMutationProbabilityattribute
-
withPopulationMutationProbability
Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for populationMutationProbability- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableProgramRandomPrunethat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:populationMutationProbability. -
toString
Prints the immutable valueProgramRandomPrunewith attribute values. -
of
Construct a new immutableProgramRandomPruneinstance.- Parameters:
populationMutationProbability- The value for thepopulationMutationProbabilityattribute- Returns:
- An immutable ProgramRandomPrune instance
-
validate
-
copyOf
Creates an immutable copy of aProgramRandomPrunevalue. 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 ProgramRandomPrune instance
-
builder
Creates a builder forProgramRandomPrune.ImmutableProgramRandomPrune.builder() .populationMutationProbability(double) // requiredpopulationMutationProbability.build();- Returns:
- A new ProgramRandomPrune builder
-