Package com.io7m.smfj.core

## Class SMFHeader

- java.lang.Object
- - com.io7m.smfj.core.SMFHeader

- All Implemented Interfaces:
    `SMFHeaderType`

      public final class SMFHeader
      extends java.lang.Object
      implements SMFHeaderType

  Information about an SMF file.

- - ### Nested Class Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.SortedMap<SMFAttributeName,​SMFAttribute>` | `attributesByName()` |
    `java.util.List<SMFAttribute>` | `attributesInOrder()` |
    `static SMFHeader.Builder` | `builder()` | Creates a builder for `SMFHeader`.
    `SMFCoordinateSystem` | `coordinateSystem()` |
    `static SMFHeader` | `copyOf​(SMFHeaderType instance)` | Creates an immutable copy of a `SMFHeaderType` value.
    `java.nio.ByteOrder` | `dataByteOrder()` |
    `boolean` | `equals​(java.lang.Object another)` | This instance is equal to all instances of `SMFHeader` that have equal attribute values.
    `int` | `hashCode()` | Computes a hash code from attributes: `triangles`, `vertexCount`, `schemaIdentifier`, `coordinateSystem`, `dataByteOrder`, `attributesInOrder`, `attributesByName`.
    `static SMFHeader` | `of​(SMFTriangles triangles, long vertexCount, java.util.Optional<? extends SMFSchemaIdentifier> schemaIdentifier, SMFCoordinateSystem coordinateSystem, java.nio.ByteOrder dataByteOrder, java.lang.Iterable<? extends SMFAttribute> attributesInOrder)` | Construct a new immutable `SMFHeader` instance.
    `static SMFHeader` | `of​(SMFTriangles triangles, long vertexCount, java.util.Optional<SMFSchemaIdentifier> schemaIdentifier, SMFCoordinateSystem coordinateSystem, java.nio.ByteOrder dataByteOrder, java.util.List<SMFAttribute> attributesInOrder)` | Construct a new immutable `SMFHeader` instance.
    `java.util.Optional<SMFSchemaIdentifier>` | `schemaIdentifier()` |
    `java.lang.String` | `toString()` | Prints the immutable value `SMFHeader` with attribute values.
    `SMFTriangles` | `triangles()` |
    `long` | `vertexCount()` |
    `SMFHeader` | `withAttributesInOrder​(SMFAttribute... elements)` | Copy the current immutable object with elements that replace the content of `attributesInOrder`.
    `SMFHeader` | `withAttributesInOrder​(java.lang.Iterable<? extends SMFAttribute> elements)` | Copy the current immutable object with elements that replace the content of `attributesInOrder`.
    `SMFHeader` | `withCoordinateSystem​(SMFCoordinateSystem value)` | Copy the current immutable object by setting a value for the `coordinateSystem` attribute.
    `SMFHeader` | `withDataByteOrder​(java.nio.ByteOrder value)` | Copy the current immutable object by setting a value for the `dataByteOrder` attribute.
    `SMFHeader` | `withSchemaIdentifier​(SMFSchemaIdentifier value)` | Copy the current immutable object by setting a present value for the optional `schemaIdentifier` attribute.
    `SMFHeader` | `withSchemaIdentifier​(java.util.Optional<? extends SMFSchemaIdentifier> optional)` | Copy the current immutable object by setting an optional value for the `schemaIdentifier` attribute.
    `SMFHeader` | `withTriangles​(SMFTriangles value)` | Copy the current immutable object by setting a value for the `triangles` attribute.
    `SMFHeader` | `withVertexCount​(long value)` | Copy the current immutable object by setting a value for the `vertexCount` attribute.

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

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

    - ### Methods inherited from interface com.io7m.smfj.core.SMFHeaderType

      `checkPreconditions`

- - ### Method Detail

    - #### triangles

          public SMFTriangles triangles()

      Specified by:
        `triangles` in interface `SMFHeaderType`
      Returns:
        The triangle information for the file

    - #### vertexCount

          public long vertexCount()

      Specified by:
        `vertexCount` in interface `SMFHeaderType`
      Returns:
        The number of vertices in the file

    - #### schemaIdentifier

          public java.util.Optional<SMFSchemaIdentifier> schemaIdentifier()

      Specified by:
        `schemaIdentifier` in interface `SMFHeaderType`
      Returns:
        The schema ID in the file

    - #### coordinateSystem

          public SMFCoordinateSystem coordinateSystem()

      Specified by:
        `coordinateSystem` in interface `SMFHeaderType`
      Returns:
        The coordinate system of the mesh data

    - #### dataByteOrder

          public java.nio.ByteOrder dataByteOrder()

      Specified by:
        `dataByteOrder` in interface `SMFHeaderType`
      Returns:
        The endianness of the mesh data

    - #### attributesInOrder

          public java.util.List<SMFAttribute> attributesInOrder()

      Specified by:
        `attributesInOrder` in interface `SMFHeaderType`
      Returns:
        The attributes in the order that they appeared in the file

    - #### attributesByName

          public java.util.SortedMap<SMFAttributeName,​SMFAttribute> attributesByName()

      Specified by:
        `attributesByName` in interface `SMFHeaderType`
      Returns:
        The attributes by name

    - #### withTriangles

          public final SMFHeader withTriangles​(SMFTriangles value)

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

    - #### withVertexCount

          public final SMFHeader withVertexCount​(long value)

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

    - #### withSchemaIdentifier

          public final SMFHeader withSchemaIdentifier​(SMFSchemaIdentifier value)

      Copy the current immutable object by setting a present value for the optional `schemaIdentifier` attribute.
      Parameters:
        `value` - The value for schemaIdentifier
      Returns:
        A modified copy of `this` object

    - #### withSchemaIdentifier

          public final SMFHeader withSchemaIdentifier​(java.util.Optional<? extends SMFSchemaIdentifier> optional)

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

    - #### withCoordinateSystem

          public final SMFHeader withCoordinateSystem​(SMFCoordinateSystem value)

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

    - #### withDataByteOrder

          public final SMFHeader withDataByteOrder​(java.nio.ByteOrder value)

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

    - #### withAttributesInOrder

          public final SMFHeader withAttributesInOrder​(SMFAttribute... elements)

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

    - #### withAttributesInOrder

          public final SMFHeader withAttributesInOrder​(java.lang.Iterable<? extends SMFAttribute> elements)

      Copy the current immutable object with elements that replace the content of `attributesInOrder`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `elements` - An iterable of attributesInOrder 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 `SMFHeader` 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: `triangles`, `vertexCount`, `schemaIdentifier`, `coordinateSystem`, `dataByteOrder`, `attributesInOrder`, `attributesByName`.
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        hashCode value

    - #### toString

          public java.lang.String toString()

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

    - #### of

          public static SMFHeader of​(SMFTriangles triangles,
                                     long vertexCount,
                                     java.util.Optional<SMFSchemaIdentifier> schemaIdentifier,
                                     SMFCoordinateSystem coordinateSystem,
                                     java.nio.ByteOrder dataByteOrder,
                                     java.util.List<SMFAttribute> attributesInOrder)

      Construct a new immutable `SMFHeader` instance.
      Parameters:
        `triangles` - The value for the `triangles` attribute
        `vertexCount` - The value for the `vertexCount` attribute
        `schemaIdentifier` - The value for the `schemaIdentifier` attribute
        `coordinateSystem` - The value for the `coordinateSystem` attribute
        `dataByteOrder` - The value for the `dataByteOrder` attribute
        `attributesInOrder` - The value for the `attributesInOrder` attribute
      Returns:
        An immutable SMFHeader instance

    - #### of

          public static SMFHeader of​(SMFTriangles triangles,
                                     long vertexCount,
                                     java.util.Optional<? extends SMFSchemaIdentifier> schemaIdentifier,
                                     SMFCoordinateSystem coordinateSystem,
                                     java.nio.ByteOrder dataByteOrder,
                                     java.lang.Iterable<? extends SMFAttribute> attributesInOrder)

      Construct a new immutable `SMFHeader` instance.
      Parameters:
        `triangles` - The value for the `triangles` attribute
        `vertexCount` - The value for the `vertexCount` attribute
        `schemaIdentifier` - The value for the `schemaIdentifier` attribute
        `coordinateSystem` - The value for the `coordinateSystem` attribute
        `dataByteOrder` - The value for the `dataByteOrder` attribute
        `attributesInOrder` - The value for the `attributesInOrder` attribute
      Returns:
        An immutable SMFHeader instance

    - #### copyOf

          public static SMFHeader copyOf​(SMFHeaderType instance)

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

    - #### builder

          public static SMFHeader.Builder builder()

      Creates a builder for `SMFHeader`.

           SMFHeader.builder()
              .setTriangles(com.io7m.smfj.core.SMFTriangles) // optional triangles
              .setVertexCount(long) // optional vertexCount
              .setSchemaIdentifier(SMFSchemaIdentifier) // optional schemaIdentifier
              .setCoordinateSystem(com.io7m.smfj.core.SMFCoordinateSystem) // optional coordinateSystem
              .setDataByteOrder(java.nio.ByteOrder) // optional dataByteOrder
              .addAttributesInOrder|addAllAttributesInOrder(SMFAttribute) // attributesInOrder elements
              .build();

      Returns:
        A new SMFHeader builder