Class ImmutableProgramTreeChromosomeSpec
java.lang.Object
net.bmahe.genetics4j.gp.spec.chromosome.ProgramTreeChromosomeSpec
net.bmahe.genetics4j.gp.spec.chromosome.ImmutableProgramTreeChromosomeSpec
- All Implemented Interfaces:
ChromosomeSpec
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableProgramTreeChromosomeSpec
extends ProgramTreeChromosomeSpec
Immutable implementation of
ProgramTreeChromosomeSpec
.
Use the builder to create immutable instances:
ImmutableProgramTreeChromosomeSpec.builder()
.
Use the static factory method to create immutable instances:
ImmutableProgramTreeChromosomeSpec.of()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableProgramTreeChromosomeSpec
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
private
ImmutableProgramTreeChromosomeSpec
(ImmutableProgramTreeChromosomeSpec original, Program program) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableProgramTreeChromosomeSpec
.copyOf
(ProgramTreeChromosomeSpec instance) Creates an immutable copy of aProgramTreeChromosomeSpec
value.boolean
This instance is equal to all instances ofImmutableProgramTreeChromosomeSpec
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableProgramTreeChromosomeSpec another) int
hashCode()
Computes a hash code from attributes:program
.Construct a new immutableProgramTreeChromosomeSpec
instance.program()
toString()
Prints the immutable valueProgramTreeChromosomeSpec
with attribute values.withProgram
(Program value) Copy the current immutable object by setting a value for theprogram
attribute.
-
Field Details
-
program
-
-
Constructor Details
-
ImmutableProgramTreeChromosomeSpec
-
ImmutableProgramTreeChromosomeSpec
private ImmutableProgramTreeChromosomeSpec(ImmutableProgramTreeChromosomeSpec original, Program program)
-
-
Method Details
-
program
- Specified by:
program
in classProgramTreeChromosomeSpec
- Returns:
- The value of the
program
attribute
-
withProgram
Copy the current immutable object by setting a value for theprogram
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for program- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableProgramTreeChromosomeSpec
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:program
. -
toString
Prints the immutable valueProgramTreeChromosomeSpec
with attribute values. -
of
Construct a new immutableProgramTreeChromosomeSpec
instance.- Parameters:
program
- The value for theprogram
attribute- Returns:
- An immutable ProgramTreeChromosomeSpec instance
-
copyOf
Creates an immutable copy of aProgramTreeChromosomeSpec
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 ProgramTreeChromosomeSpec instance
-
builder
Creates a builder forImmutableProgramTreeChromosomeSpec
.ImmutableProgramTreeChromosomeSpec.builder() .program(net.bmahe.genetics4j.gp.program.Program) // required
program
.build();- Returns:
- A new ImmutableProgramTreeChromosomeSpec builder
-