Class ImmutableCLData
java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.cldata.ImmutableCLData
- All Implemented Interfaces:
CLData
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableCLData
extends Object
implements CLData
Immutable implementation of
CLData
.
Use the builder to create immutable instances:
ImmutableCLData.builder()
.
Use the static factory method to create immutable instances:
ImmutableCLData.of()
.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableCLData
(ImmutableCLData original, org.jocl.cl_mem clMem, int clType, int size) private
ImmutableCLData
(org.jocl.cl_mem clMem, int clType, int size) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCLData.Builder
builder()
Creates a builder forImmutableCLData
.org.jocl.cl_mem
clMem()
OpenCL cl_mem that references the raw dataint
clType()
OpenCL type contained within the clMem()static ImmutableCLData
Creates an immutable copy of aCLData
value.boolean
This instance is equal to all instances ofImmutableCLData
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableCLData another) int
hashCode()
Computes a hash code from attributes:clMem
,clType
,size
.static ImmutableCLData
of
(org.jocl.cl_mem clMem, int clType, int size) Construct a new immutableCLData
instance.int
size()
How many entries in the clMem()toString()
Prints the immutable valueCLData
with attribute values.final ImmutableCLData
withClMem
(org.jocl.cl_mem value) Copy the current immutable object by setting a value for theclMem
attribute.final ImmutableCLData
withClType
(int value) Copy the current immutable object by setting a value for theclType
attribute.final ImmutableCLData
withSize
(int value) Copy the current immutable object by setting a value for thesize
attribute.
-
Field Details
-
clMem
private final org.jocl.cl_mem clMem -
clType
private final int clType -
size
private final int size
-
-
Constructor Details
-
ImmutableCLData
private ImmutableCLData(org.jocl.cl_mem clMem, int clType, int size) -
ImmutableCLData
-
-
Method Details
-
clMem
public org.jocl.cl_mem clMem()OpenCL cl_mem that references the raw data -
clType
public int clType()OpenCL type contained within the clMem() -
size
public int size()How many entries in the clMem() -
withClMem
Copy the current immutable object by setting a value for theclMem
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for clMem- Returns:
- A modified copy of the
this
object
-
withClType
Copy the current immutable object by setting a value for theclType
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for clType- Returns:
- A modified copy of the
this
object
-
withSize
Copy the current immutable object by setting a value for thesize
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for size- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableCLData
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:clMem
,clType
,size
. -
toString
Prints the immutable valueCLData
with attribute values. -
of
Construct a new immutableCLData
instance.- Parameters:
clMem
- The value for theclMem
attributeclType
- The value for theclType
attributesize
- The value for thesize
attribute- Returns:
- An immutable CLData instance
-
copyOf
Creates an immutable copy of aCLData
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 CLData instance
-
builder
Creates a builder forImmutableCLData
.ImmutableCLData.builder() .clMem(org.jocl.cl_mem) // required
clMem
.clType(int) // requiredclType
.size(int) // requiredsize
.build();- Returns:
- A new ImmutableCLData builder
-