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().

  • 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

      private ImmutableCLData(ImmutableCLData original, org.jocl.cl_mem clMem, int clType, int size)
  • Method Details

    • clMem

      public org.jocl.cl_mem clMem()
      OpenCL cl_mem that references the raw data
      Specified by:
      clMem in interface CLData
      Returns:
    • clType

      public int clType()
      OpenCL type contained within the clMem()
      Specified by:
      clType in interface CLData
      Returns:
    • size

      public int size()
      How many entries in the clMem()
      Specified by:
      size in interface CLData
      Returns:
    • withClMem

      public final ImmutableCLData withClMem(org.jocl.cl_mem value)
      Copy the current immutable object by setting a value for the clMem attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for clMem
      Returns:
      A modified copy of the this object
    • withClType

      public final ImmutableCLData withClType(int value)
      Copy the current immutable object by setting a value for the clType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for clType
      Returns:
      A modified copy of the this object
    • withSize

      public final ImmutableCLData withSize(int value)
      Copy the current immutable object by setting a value for the size attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for size
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableCLData that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableCLData another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: clMem, clType, size.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value CLData with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static ImmutableCLData of(org.jocl.cl_mem clMem, int clType, int size)
      Construct a new immutable CLData instance.
      Parameters:
      clMem - The value for the clMem attribute
      clType - The value for the clType attribute
      size - The value for the size attribute
      Returns:
      An immutable CLData instance
    • copyOf

      public static ImmutableCLData copyOf(CLData instance)
      Creates an immutable copy of a CLData 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

      public static ImmutableCLData.Builder builder()
      Creates a builder for ImmutableCLData.
       ImmutableCLData.builder()
          .clMem(org.jocl.cl_mem) // required clMem
          .clType(int) // required clType
          .size(int) // required size
          .build();
       
      Returns:
      A new ImmutableCLData builder