Class ImmutableChromosomeFactoryProvider
java.lang.Object
net.bmahe.genetics4j.core.chromosomes.factory.ChromosomeFactoryProvider
net.bmahe.genetics4j.core.chromosomes.factory.ImmutableChromosomeFactoryProvider
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableChromosomeFactoryProvider
extends ChromosomeFactoryProvider
Immutable implementation of
ChromosomeFactoryProvider
.
Use the builder to create immutable instances:
ImmutableChromosomeFactoryProvider.builder()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableChromosomeFactoryProvider
.private final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<ChromosomeFactory<? extends Chromosome>> private final List
<Function<ChromosomeFactoryProvider, ChromosomeFactory<? extends Chromosome>>> private final List
<ChromosomeFactory<? extends Chromosome>> private final RandomGenerator
private static final byte
private static final byte
private static final byte
Fields inherited from class net.bmahe.genetics4j.core.chromosomes.factory.ChromosomeFactoryProvider
logger
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableChromosomeFactoryProvider
(RandomGenerator randomGenerator, List<ChromosomeFactory<? extends Chromosome>> defaultChromosomeFactories, List<Function<ChromosomeFactoryProvider, ChromosomeFactory<? extends Chromosome>>> chromosomeFactoriesGenerator) private
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableChromosomeFactoryProvider
.List
<ChromosomeFactory<? extends Chromosome>> List
<Function<ChromosomeFactoryProvider, ChromosomeFactory<? extends Chromosome>>> copyOf
(ChromosomeFactoryProvider instance) Creates an immutable copy of aChromosomeFactoryProvider
value.private static <T> List
<T> createSafeList
(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> List
<T> createUnmodifiableList
(boolean clone, List<T> list) List
<ChromosomeFactory<? extends Chromosome>> boolean
This instance is equal to all instances ofImmutableChromosomeFactoryProvider
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableChromosomeFactoryProvider another) int
hashCode()
Computes a hash code from attributes:randomGenerator
,defaultChromosomeFactories
,chromosomeFactoriesGenerator
,chromosomeFactories
.toString()
Prints the immutable valueChromosomeFactoryProvider
with attribute values.withChromosomeFactoriesGenerator
(Iterable<? extends Function<ChromosomeFactoryProvider, ChromosomeFactory<? extends Chromosome>>> elements) Copy the current immutable object with elements that replace the content ofchromosomeFactoriesGenerator
.withChromosomeFactoriesGenerator
(Function<ChromosomeFactoryProvider, ChromosomeFactory<? extends Chromosome>>... elements) Copy the current immutable object with elements that replace the content ofchromosomeFactoriesGenerator
.withDefaultChromosomeFactories
(Iterable<? extends ChromosomeFactory<? extends Chromosome>> elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeFactories
.withDefaultChromosomeFactories
(ChromosomeFactory<? extends Chromosome>... elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeFactories
.Copy the current immutable object by setting a value for therandomGenerator
attribute.Methods inherited from class net.bmahe.genetics4j.core.chromosomes.factory.ChromosomeFactoryProvider
provideChromosomeFactory
-
Field Details
-
randomGenerator
-
defaultChromosomeFactories
-
chromosomeFactoriesGenerator
private final List<Function<ChromosomeFactoryProvider,ChromosomeFactory<? extends Chromosome>>> chromosomeFactoriesGenerator -
chromosomeFactories
-
STAGE_INITIALIZING
private static final byte STAGE_INITIALIZING- See Also:
-
STAGE_UNINITIALIZED
private static final byte STAGE_UNINITIALIZED- See Also:
-
STAGE_INITIALIZED
private static final byte STAGE_INITIALIZED- See Also:
-
initShim
-
-
Constructor Details
-
ImmutableChromosomeFactoryProvider
-
ImmutableChromosomeFactoryProvider
private ImmutableChromosomeFactoryProvider(RandomGenerator randomGenerator, List<ChromosomeFactory<? extends Chromosome>> defaultChromosomeFactories, List<Function<ChromosomeFactoryProvider, ChromosomeFactory<? extends Chromosome>>> chromosomeFactoriesGenerator)
-
-
Method Details
-
randomGenerator
- Specified by:
randomGenerator
in classChromosomeFactoryProvider
- Returns:
- The value of the
randomGenerator
attribute
-
defaultChromosomeFactories
- Overrides:
defaultChromosomeFactories
in classChromosomeFactoryProvider
- Returns:
- The value of the
defaultChromosomeFactories
attribute
-
chromosomeFactoriesGenerator
public List<Function<ChromosomeFactoryProvider,ChromosomeFactory<? extends Chromosome>>> chromosomeFactoriesGenerator()- Specified by:
chromosomeFactoriesGenerator
in classChromosomeFactoryProvider
- Returns:
- The value of the
chromosomeFactoriesGenerator
attribute
-
chromosomeFactories
- Overrides:
chromosomeFactories
in classChromosomeFactoryProvider
- Returns:
- The computed-at-construction value of the
chromosomeFactories
attribute
-
withRandomGenerator
Copy the current immutable object by setting a value for therandomGenerator
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for randomGenerator- Returns:
- A modified copy of the
this
object
-
withDefaultChromosomeFactories
@SafeVarargs public final ImmutableChromosomeFactoryProvider withDefaultChromosomeFactories(ChromosomeFactory<? extends Chromosome>... elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeFactories
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withDefaultChromosomeFactories
public final ImmutableChromosomeFactoryProvider withDefaultChromosomeFactories(Iterable<? extends ChromosomeFactory<? extends Chromosome>> elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeFactories
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of defaultChromosomeFactories elements to set- Returns:
- A modified copy of
this
object
-
withChromosomeFactoriesGenerator
@SafeVarargs public final ImmutableChromosomeFactoryProvider withChromosomeFactoriesGenerator(Function<ChromosomeFactoryProvider, ChromosomeFactory<? extends Chromosome>>... elements) Copy the current immutable object with elements that replace the content ofchromosomeFactoriesGenerator
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withChromosomeFactoriesGenerator
public final ImmutableChromosomeFactoryProvider withChromosomeFactoriesGenerator(Iterable<? extends Function<ChromosomeFactoryProvider, ChromosomeFactory<? extends Chromosome>>> elements) Copy the current immutable object with elements that replace the content ofchromosomeFactoriesGenerator
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of chromosomeFactoriesGenerator elements to set- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableChromosomeFactoryProvider
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:randomGenerator
,defaultChromosomeFactories
,chromosomeFactoriesGenerator
,chromosomeFactories
. -
toString
Prints the immutable valueChromosomeFactoryProvider
with attribute values. -
copyOf
Creates an immutable copy of aChromosomeFactoryProvider
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 ChromosomeFactoryProvider instance
-
builder
Creates a builder forImmutableChromosomeFactoryProvider
.ImmutableChromosomeFactoryProvider.builder() .randomGenerator(random.RandomGenerator) // required
randomGenerator
.addDefaultChromosomeFactories|addAllDefaultChromosomeFactories(net.bmahe.genetics4j.core.chromosomes.factory.ChromosomeFactory<? extends net.bmahe.genetics4j.core.chromosomes.Chromosome>) //defaultChromosomeFactories
elements .addChromosomeFactoriesGenerator|addAllChromosomeFactoriesGenerator(function.Function<net.bmahe.genetics4j.core.chromosomes.factory.ChromosomeFactoryProvider, net.bmahe.genetics4j.core.chromosomes.factory.ChromosomeFactory<? extends net.bmahe.genetics4j.core.chromosomes.Chromosome>>) //chromosomeFactoriesGenerator
elements .build();- Returns:
- A new ImmutableChromosomeFactoryProvider builder
-
createSafeList
-
createUnmodifiableList
-