Package com.io7m.smfj.processing.api

## Class SMFMemoryMesh

- java.lang.Object
- - com.io7m.smfj.processing.api.SMFMemoryMesh

- All Implemented Interfaces:
    `SMFMemoryMeshType`

      public final class SMFMemoryMesh
      extends java.lang.Object
      implements SMFMemoryMeshType

  An immutable in-memory copy of a mesh.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `SMFMemoryMesh.Builder` | Builds instances of type `SMFMemoryMesh`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.Map<SMFAttributeName,​SMFAttributeArrayType>` | `arrays()` |
    `static SMFMemoryMesh.Builder` | `builder()` | Creates a builder for `SMFMemoryMesh`.
    `static SMFMemoryMesh` | `copyOf​(SMFMemoryMeshType instance)` | Creates an immutable copy of a `SMFMemoryMeshType` value.
    `boolean` | `equals​(java.lang.Object another)` | This instance is equal to all instances of `SMFMemoryMesh` that have equal attribute values.
    `int` | `hashCode()` | Computes a hash code from attributes: `header`, `arrays`, `metadata`, `triangles`.
    `SMFHeader` | `header()` |
    `java.util.List<SMFMetadata>` | `metadata()` |
    `static SMFMemoryMesh` | `of​(SMFHeader header, java.util.Map<? extends SMFAttributeName,​? extends SMFAttributeArrayType> arrays, java.lang.Iterable<? extends SMFMetadata> metadata, java.lang.Iterable<? extends com.io7m.jtensors.core.unparameterized.vectors.Vector3L> triangles)` | Construct a new immutable `SMFMemoryMesh` instance.
    `static SMFMemoryMesh` | `of​(SMFHeader header, java.util.Map<SMFAttributeName,​SMFAttributeArrayType> arrays, java.util.List<SMFMetadata> metadata, java.util.List<com.io7m.jtensors.core.unparameterized.vectors.Vector3L> triangles)` | Construct a new immutable `SMFMemoryMesh` instance.
    `java.lang.String` | `toString()` | Prints the immutable value `SMFMemoryMesh` with attribute values.
    `java.util.List<com.io7m.jtensors.core.unparameterized.vectors.Vector3L>` | `triangles()` |
    `SMFMemoryMesh` | `withArrays​(java.util.Map<? extends SMFAttributeName,​? extends SMFAttributeArrayType> entries)` | Copy the current immutable object by replacing the `arrays` map with the specified map.
    `SMFMemoryMesh` | `withHeader​(SMFHeader value)` | Copy the current immutable object by setting a value for the `header` attribute.
    `SMFMemoryMesh` | `withMetadata​(SMFMetadata... elements)` | Copy the current immutable object with elements that replace the content of `metadata`.
    `SMFMemoryMesh` | `withMetadata​(java.lang.Iterable<? extends SMFMetadata> elements)` | Copy the current immutable object with elements that replace the content of `metadata`.
    `SMFMemoryMesh` | `withTriangles​(com.io7m.jtensors.core.unparameterized.vectors.Vector3L... elements)` | Copy the current immutable object with elements that replace the content of `triangles`.
    `SMFMemoryMesh` | `withTriangles​(java.lang.Iterable<? extends com.io7m.jtensors.core.unparameterized.vectors.Vector3L> elements)` | Copy the current immutable object with elements that replace the content of `triangles`.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.io7m.smfj.processing.api.SMFMemoryMeshType

      `checkPreconditions`

- - ### Method Detail

    - #### header

          public SMFHeader header()

      Specified by:
        `header` in interface `SMFMemoryMeshType`
      Returns:
        The mesh header

    - #### arrays

          public java.util.Map<SMFAttributeName,​SMFAttributeArrayType> arrays()

      Specified by:
        `arrays` in interface `SMFMemoryMeshType`
      Returns:
        The mesh attribute arrays

    - #### metadata

          public java.util.List<SMFMetadata> metadata()

      Specified by:
        `metadata` in interface `SMFMemoryMeshType`
      Returns:
        The parsed metadata

    - #### triangles

          public java.util.List<com.io7m.jtensors.core.unparameterized.vectors.Vector3L> triangles()

      Specified by:
        `triangles` in interface `SMFMemoryMeshType`
      Returns:
        The triangles

    - #### withHeader

          public final SMFMemoryMesh withHeader​(SMFHeader value)

      Copy the current immutable object by setting a value for the `header` attribute. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `value` - A new value for header
      Returns:
        A modified copy of the `this` object

    - #### withArrays

          public final SMFMemoryMesh withArrays​(java.util.Map<? extends SMFAttributeName,​? extends SMFAttributeArrayType> entries)

      Copy the current immutable object by replacing the `arrays` map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `entries` - The entries to be added to the arrays map
      Returns:
        A modified copy of `this` object

    - #### withMetadata

          public final SMFMemoryMesh withMetadata​(SMFMetadata... elements)

      Copy the current immutable object with elements that replace the content of `metadata`.
      Parameters:
        `elements` - The elements to set
      Returns:
        A modified copy of `this` object

    - #### withMetadata

          public final SMFMemoryMesh withMetadata​(java.lang.Iterable<? extends SMFMetadata> elements)

      Copy the current immutable object with elements that replace the content of `metadata`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `elements` - An iterable of metadata elements to set
      Returns:
        A modified copy of `this` object

    - #### withTriangles

          public final SMFMemoryMesh withTriangles​(com.io7m.jtensors.core.unparameterized.vectors.Vector3L... elements)

      Copy the current immutable object with elements that replace the content of `triangles`.
      Parameters:
        `elements` - The elements to set
      Returns:
        A modified copy of `this` object

    - #### withTriangles

          public final SMFMemoryMesh withTriangles​(java.lang.Iterable<? extends com.io7m.jtensors.core.unparameterized.vectors.Vector3L> elements)

      Copy the current immutable object with elements that replace the content of `triangles`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `elements` - An iterable of triangles elements to set
      Returns:
        A modified copy of `this` object

    - #### equals

          public boolean equals​(java.lang.Object another)

      This instance is equal to all instances of `SMFMemoryMesh` that have equal attribute values.
      Overrides:
        `equals` in class `java.lang.Object`
      Returns:
        `true` if `this` is equal to `another` instance

    - #### hashCode

          public int hashCode()

      Computes a hash code from attributes: `header`, `arrays`, `metadata`, `triangles`.
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        hashCode value

    - #### toString

          public java.lang.String toString()

      Prints the immutable value `SMFMemoryMesh` with attribute values.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A string representation of the value

    - #### of

          public static SMFMemoryMesh of​(SMFHeader header,
                                         java.util.Map<SMFAttributeName,​SMFAttributeArrayType> arrays,
                                         java.util.List<SMFMetadata> metadata,
                                         java.util.List<com.io7m.jtensors.core.unparameterized.vectors.Vector3L> triangles)

      Construct a new immutable `SMFMemoryMesh` instance.
      Parameters:
        `header` - The value for the `header` attribute
        `arrays` - The value for the `arrays` attribute
        `metadata` - The value for the `metadata` attribute
        `triangles` - The value for the `triangles` attribute
      Returns:
        An immutable SMFMemoryMesh instance

    - #### of

          public static SMFMemoryMesh of​(SMFHeader header,
                                         java.util.Map<? extends SMFAttributeName,​? extends SMFAttributeArrayType> arrays,
                                         java.lang.Iterable<? extends SMFMetadata> metadata,
                                         java.lang.Iterable<? extends com.io7m.jtensors.core.unparameterized.vectors.Vector3L> triangles)

      Construct a new immutable `SMFMemoryMesh` instance.
      Parameters:
        `header` - The value for the `header` attribute
        `arrays` - The value for the `arrays` attribute
        `metadata` - The value for the `metadata` attribute
        `triangles` - The value for the `triangles` attribute
      Returns:
        An immutable SMFMemoryMesh instance

    - #### copyOf

          public static SMFMemoryMesh copyOf​(SMFMemoryMeshType instance)

      Creates an immutable copy of a `SMFMemoryMeshType` 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 SMFMemoryMesh instance

    - #### builder

          public static SMFMemoryMesh.Builder builder()

      Creates a builder for `SMFMemoryMesh`.

           SMFMemoryMesh.builder()
              .setHeader(com.io7m.smfj.core.SMFHeader) // required header
              .putArrays|putAllArrays(com.io7m.smfj.core.SMFAttributeName => com.io7m.smfj.processing.api.SMFAttributeArrayType) // arrays mappings
              .addMetadata|addAllMetadata(SMFMetadata) // metadata elements
              .addTriangles|addAllTriangles(com.io7m.jtensors.core.unparameterized.vectors.Vector3L) // triangles elements
              .build();

      Returns:
        A new SMFMemoryMesh builder