Class ImmutableCLData.Builder

java.lang.Object
net.bmahe.genetics4j.gpu.spec.fitness.cldata.ImmutableCLData.Builder
Enclosing class:
ImmutableCLData

public static final class ImmutableCLData.Builder extends Object
Builds instances of type ImmutableCLData. 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 Details

    • INIT_BIT_CL_MEM

      private static final long INIT_BIT_CL_MEM
      See Also:
    • INIT_BIT_CL_TYPE

      private static final long INIT_BIT_CL_TYPE
      See Also:
    • INIT_BIT_SIZE

      private static final long INIT_BIT_SIZE
      See Also:
    • initBits

      private long initBits
    • clMem

      private org.jocl.cl_mem clMem
    • clType

      private int clType
    • size

      private int size
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • from

      public final ImmutableCLData.Builder from(CLData instance)
      Fill a builder with attribute values from the provided CLData instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • clMem

      public final ImmutableCLData.Builder clMem(org.jocl.cl_mem clMem)
      Initializes the value for the clMem attribute.
      Parameters:
      clMem - The value for clMem
      Returns:
      this builder for use in a chained invocation
    • clType

      public final ImmutableCLData.Builder clType(int clType)
      Initializes the value for the clType attribute.
      Parameters:
      clType - The value for clType
      Returns:
      this builder for use in a chained invocation
    • size

      public final ImmutableCLData.Builder size(int size)
      Initializes the value for the size attribute.
      Parameters:
      size - The value for size
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableCLData build()
      Builds a new ImmutableCLData.
      Returns:
      An immutable instance of CLData
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()