Class ImmutableProgramTreeChromosomeSpec
java.lang.Object
net.bmahe.genetics4j.gp.spec.chromosome.ProgramTreeChromosomeSpec
net.bmahe.genetics4j.gp.spec.chromosome.ImmutableProgramTreeChromosomeSpec
- All Implemented Interfaces:
ChromosomeSpec
@Generated(from="ProgramTreeChromosomeSpec",
generator="Immutables")
@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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeProgramTreeChromosomeSpec. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprivateImmutableProgramTreeChromosomeSpec(ImmutableProgramTreeChromosomeSpec original, Program program) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forProgramTreeChromosomeSpec.static ProgramTreeChromosomeSpeccopyOf(ProgramTreeChromosomeSpec instance) Creates an immutable copy of aProgramTreeChromosomeSpecvalue.booleanThis instance is equal to all instances ofImmutableProgramTreeChromosomeSpecthat have equal attribute values.private booleaninthashCode()Computes a hash code from attributes:program.static ProgramTreeChromosomeSpecConstruct a new immutableProgramTreeChromosomeSpecinstance.program()toString()Prints the immutable valueProgramTreeChromosomeSpecwith attribute values.withProgram(Program value) Copy the current immutable object by setting a value for theprogramattribute.
-
Field Details
-
program
-
-
Constructor Details
-
ImmutableProgramTreeChromosomeSpec
-
ImmutableProgramTreeChromosomeSpec
private ImmutableProgramTreeChromosomeSpec(ImmutableProgramTreeChromosomeSpec original, Program program)
-
-
Method Details
-
program
- Specified by:
programin classProgramTreeChromosomeSpec- Returns:
- The value of the
programattribute
-
withProgram
Copy the current immutable object by setting a value for theprogramattribute. 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 or the
thisobject
-
equals
This instance is equal to all instances ofImmutableProgramTreeChromosomeSpecthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:program. -
toString
Prints the immutable valueProgramTreeChromosomeSpecwith attribute values. -
of
Construct a new immutableProgramTreeChromosomeSpecinstance.- Parameters:
program- The value for theprogramattribute- Returns:
- An immutable ProgramTreeChromosomeSpec instance
-
copyOf
Creates an immutable copy of aProgramTreeChromosomeSpecvalue. 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 forProgramTreeChromosomeSpec.ImmutableProgramTreeChromosomeSpec.builder() .program(net.bmahe.genetics4j.gp.program.Program) // requiredprogram.build();- Returns:
- A new ProgramTreeChromosomeSpec builder
-