Class ImmutableSingleKernelFitnessDescriptor.Builder
java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.ImmutableSingleKernelFitnessDescriptor.Builder
- Direct Known Subclasses:
SingleKernelFitnessDescriptor.Builder
- Enclosing class:
ImmutableSingleKernelFitnessDescriptor
Builds instances of type
ImmutableSingleKernelFitnessDescriptor
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Field Summary
Modifier and TypeFieldDescriptionprivate Map
<Integer, DataLoader> private static final long
private static final long
private long
private KernelExecutionContextComputer
private String
private Map
<Integer, LocalMemoryAllocator> private Map
<Integer, ResultAllocator> private Map
<Integer, StaticDataLoader> -
Constructor Summary
ConstructorDescriptionBuilder()
Creates a builder forImmutableSingleKernelFitnessDescriptor
instances. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableSingleKernelFitnessDescriptor
.dataLoaders
(Map<Integer, ? extends DataLoader> entries) Sets or replaces all mappings from the specified map as entries for thedataLoaders
map.private String
from
(SingleKernelFitnessDescriptor instance) Fill a builder with attribute values from the providedSingleKernelFitnessDescriptor
instance.kernelExecutionContextComputer
(KernelExecutionContextComputer kernelExecutionContextComputer) Initializes the value for thekernelExecutionContextComputer
attribute.kernelName
(String kernelName) Initializes the value for thekernelName
attribute.localMemoryAllocators
(Map<Integer, ? extends LocalMemoryAllocator> entries) Sets or replaces all mappings from the specified map as entries for thelocalMemoryAllocators
map.putAllDataLoaders
(Map<Integer, ? extends DataLoader> entries) Put all mappings from the specified map as entries todataLoaders
map.putAllLocalMemoryAllocators
(Map<Integer, ? extends LocalMemoryAllocator> entries) Put all mappings from the specified map as entries tolocalMemoryAllocators
map.putAllResultAllocators
(Map<Integer, ? extends ResultAllocator> entries) Put all mappings from the specified map as entries toresultAllocators
map.putAllStaticDataLoaders
(Map<Integer, ? extends StaticDataLoader> entries) Put all mappings from the specified map as entries tostaticDataLoaders
map.putDataLoaders
(int key, DataLoader value) Put one entry to thedataLoaders
map.putDataLoaders
(Map.Entry<Integer, ? extends DataLoader> entry) Put one entry to thedataLoaders
map.putLocalMemoryAllocators
(int key, LocalMemoryAllocator value) Put one entry to thelocalMemoryAllocators
map.putLocalMemoryAllocators
(Map.Entry<Integer, ? extends LocalMemoryAllocator> entry) Put one entry to thelocalMemoryAllocators
map.putResultAllocators
(int key, ResultAllocator value) Put one entry to theresultAllocators
map.putResultAllocators
(Map.Entry<Integer, ? extends ResultAllocator> entry) Put one entry to theresultAllocators
map.putStaticDataLoaders
(int key, StaticDataLoader value) Put one entry to thestaticDataLoaders
map.putStaticDataLoaders
(Map.Entry<Integer, ? extends StaticDataLoader> entry) Put one entry to thestaticDataLoaders
map.resultAllocators
(Map<Integer, ? extends ResultAllocator> entries) Sets or replaces all mappings from the specified map as entries for theresultAllocators
map.staticDataLoaders
(Map<Integer, ? extends StaticDataLoader> entries) Sets or replaces all mappings from the specified map as entries for thestaticDataLoaders
map.
-
Field Details
-
INIT_BIT_KERNEL_NAME
private static final long INIT_BIT_KERNEL_NAME- See Also:
-
INIT_BIT_KERNEL_EXECUTION_CONTEXT_COMPUTER
private static final long INIT_BIT_KERNEL_EXECUTION_CONTEXT_COMPUTER- See Also:
-
initBits
private long initBits -
kernelName
-
kernelExecutionContextComputer
-
staticDataLoaders
-
dataLoaders
-
localMemoryAllocators
-
resultAllocators
-
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableSingleKernelFitnessDescriptor
instances.new SingleKernelFitnessDescriptor.Builder() .kernelName(String) // required
kernelName
.kernelExecutionContextComputer(net.bmahe.genetics4j.gpu.spec.fitness.kernelcontext.KernelExecutionContextComputer) // requiredkernelExecutionContextComputer
.putStaticDataLoaders|putAllStaticDataLoaders(int => net.bmahe.genetics4j.gpu.spec.fitness.cldata.StaticDataLoader) //staticDataLoaders
mappings .putDataLoaders|putAllDataLoaders(int => net.bmahe.genetics4j.gpu.spec.fitness.cldata.DataLoader) //dataLoaders
mappings .putLocalMemoryAllocators|putAllLocalMemoryAllocators(int => net.bmahe.genetics4j.gpu.spec.fitness.cldata.LocalMemoryAllocator) //localMemoryAllocators
mappings .putResultAllocators|putAllResultAllocators(int => net.bmahe.genetics4j.gpu.spec.fitness.cldata.ResultAllocator) //resultAllocators
mappings .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedSingleKernelFitnessDescriptor
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
kernelName
Initializes the value for thekernelName
attribute.- Parameters:
kernelName
- The value for kernelName- Returns:
this
builder for use in a chained invocation
-
kernelExecutionContextComputer
public final SingleKernelFitnessDescriptor.Builder kernelExecutionContextComputer(KernelExecutionContextComputer kernelExecutionContextComputer) Initializes the value for thekernelExecutionContextComputer
attribute.- Parameters:
kernelExecutionContextComputer
- The value for kernelExecutionContextComputer- Returns:
this
builder for use in a chained invocation
-
putStaticDataLoaders
public final SingleKernelFitnessDescriptor.Builder putStaticDataLoaders(int key, StaticDataLoader value) Put one entry to thestaticDataLoaders
map.- Parameters:
key
- The key in the staticDataLoaders mapvalue
- The associated value in the staticDataLoaders map- Returns:
this
builder for use in a chained invocation
-
putStaticDataLoaders
public final SingleKernelFitnessDescriptor.Builder putStaticDataLoaders(Map.Entry<Integer, ? extends StaticDataLoader> entry) Put one entry to thestaticDataLoaders
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
staticDataLoaders
public final SingleKernelFitnessDescriptor.Builder staticDataLoaders(Map<Integer, ? extends StaticDataLoader> entries) Sets or replaces all mappings from the specified map as entries for thestaticDataLoaders
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the staticDataLoaders map- Returns:
this
builder for use in a chained invocation
-
putAllStaticDataLoaders
public final SingleKernelFitnessDescriptor.Builder putAllStaticDataLoaders(Map<Integer, ? extends StaticDataLoader> entries) Put all mappings from the specified map as entries tostaticDataLoaders
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the staticDataLoaders map- Returns:
this
builder for use in a chained invocation
-
putDataLoaders
Put one entry to thedataLoaders
map.- Parameters:
key
- The key in the dataLoaders mapvalue
- The associated value in the dataLoaders map- Returns:
this
builder for use in a chained invocation
-
putDataLoaders
public final SingleKernelFitnessDescriptor.Builder putDataLoaders(Map.Entry<Integer, ? extends DataLoader> entry) Put one entry to thedataLoaders
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
dataLoaders
public final SingleKernelFitnessDescriptor.Builder dataLoaders(Map<Integer, ? extends DataLoader> entries) Sets or replaces all mappings from the specified map as entries for thedataLoaders
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the dataLoaders map- Returns:
this
builder for use in a chained invocation
-
putAllDataLoaders
public final SingleKernelFitnessDescriptor.Builder putAllDataLoaders(Map<Integer, ? extends DataLoader> entries) Put all mappings from the specified map as entries todataLoaders
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the dataLoaders map- Returns:
this
builder for use in a chained invocation
-
putLocalMemoryAllocators
public final SingleKernelFitnessDescriptor.Builder putLocalMemoryAllocators(int key, LocalMemoryAllocator value) Put one entry to thelocalMemoryAllocators
map.- Parameters:
key
- The key in the localMemoryAllocators mapvalue
- The associated value in the localMemoryAllocators map- Returns:
this
builder for use in a chained invocation
-
putLocalMemoryAllocators
public final SingleKernelFitnessDescriptor.Builder putLocalMemoryAllocators(Map.Entry<Integer, ? extends LocalMemoryAllocator> entry) Put one entry to thelocalMemoryAllocators
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
localMemoryAllocators
public final SingleKernelFitnessDescriptor.Builder localMemoryAllocators(Map<Integer, ? extends LocalMemoryAllocator> entries) Sets or replaces all mappings from the specified map as entries for thelocalMemoryAllocators
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the localMemoryAllocators map- Returns:
this
builder for use in a chained invocation
-
putAllLocalMemoryAllocators
public final SingleKernelFitnessDescriptor.Builder putAllLocalMemoryAllocators(Map<Integer, ? extends LocalMemoryAllocator> entries) Put all mappings from the specified map as entries tolocalMemoryAllocators
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the localMemoryAllocators map- Returns:
this
builder for use in a chained invocation
-
putResultAllocators
public final SingleKernelFitnessDescriptor.Builder putResultAllocators(int key, ResultAllocator value) Put one entry to theresultAllocators
map.- Parameters:
key
- The key in the resultAllocators mapvalue
- The associated value in the resultAllocators map- Returns:
this
builder for use in a chained invocation
-
putResultAllocators
public final SingleKernelFitnessDescriptor.Builder putResultAllocators(Map.Entry<Integer, ? extends ResultAllocator> entry) Put one entry to theresultAllocators
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
resultAllocators
public final SingleKernelFitnessDescriptor.Builder resultAllocators(Map<Integer, ? extends ResultAllocator> entries) Sets or replaces all mappings from the specified map as entries for theresultAllocators
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the resultAllocators map- Returns:
this
builder for use in a chained invocation
-
putAllResultAllocators
public final SingleKernelFitnessDescriptor.Builder putAllResultAllocators(Map<Integer, ? extends ResultAllocator> entries) Put all mappings from the specified map as entries toresultAllocators
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the resultAllocators map- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableSingleKernelFitnessDescriptor
.- Returns:
- An immutable instance of SingleKernelFitnessDescriptor
- Throws:
IllegalStateException
- if any required attributes are missing
-
formatRequiredAttributesMessage
-