com.io7m.jpra.runtime.java

## Class JPRATypeModel.JPRAVector

- java.lang.Object
- - com.io7m.jpra.runtime.java.JPRATypeModelType.JPRAVectorType
  - - com.io7m.jpra.runtime.java.JPRATypeModel.JPRAVector

- All Implemented Interfaces:
    JPRATypeModelType.JPRATypeType
  Enclosing class:
    JPRATypeModel

      public static final class JPRATypeModel.JPRAVector
      extends JPRATypeModelType.JPRAVectorType

  Immutable implementation of `JPRATypeModelType.JPRAVectorType`.

  Use the static factory method to create immutable instances: `JPRATypeModel.JPRAVector.of()`.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JPRATypeModel.JPRAVector` | `copyOf(JPRATypeModelType.JPRAVectorType instance)` Creates an immutable copy of a `JPRATypeModelType.JPRAVectorType` value.
    `JPRATypeModelType.JPRAScalarType` | `elementType()`
    `boolean` | `equals(Object another)` This instance is equal to all instances of `JPRAVector` that have equal attribute values.
    `int` | `hashCode()` Returns a precomputed-on-construction hash code from attributes: `length`, `elementType`.
    `int` | `length()`
    `static JPRATypeModel.JPRAVector` | `of(int length, JPRATypeModelType.JPRAScalarType elementType)` Construct a new immutable `JPRAVector` instance.
    `String` | `toString()` Prints the immutable value `JPRAVector` with attribute values.
    `JPRATypeModel.JPRAVector` | `withElementType(JPRATypeModelType.JPRAScalarType elementType)` Copy the current immutable object by setting a value for the `elementType` attribute.
    `JPRATypeModel.JPRAVector` | `withLength(int length)` Copy the current immutable object by setting a value for the `length` attribute.

    - ### Methods inherited from class com.io7m.jpra.runtime.java.JPRATypeModelType.JPRAVectorType

      `matchType`

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

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

- - ### Method Detail

    - #### length

          public int length()

      Returns:
        The value of the `length` attribute

    - #### elementType

          public JPRATypeModelType.JPRAScalarType elementType()

      Returns:
        The value of the `elementType` attribute

    - #### withLength

          public final JPRATypeModel.JPRAVector withLength(int length)

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

    - #### withElementType

          public final JPRATypeModel.JPRAVector withElementType(JPRATypeModelType.JPRAScalarType elementType)

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

    - #### equals

          public boolean equals(Object another)

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

    - #### hashCode

          public int hashCode()

      Returns a precomputed-on-construction hash code from attributes: `length`, `elementType`.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        hashCode value

    - #### toString

          public String toString()

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

    - #### of

          public static JPRATypeModel.JPRAVector of(int length,
                                                    JPRATypeModelType.JPRAScalarType elementType)

      Construct a new immutable `JPRAVector` instance.
      Parameters:
        `length` - The value for the `length` attribute
        `elementType` - The value for the `elementType` attribute
      Returns:
        An immutable JPRAVector instance

    - #### copyOf

          public static JPRATypeModel.JPRAVector copyOf(JPRATypeModelType.JPRAVectorType instance)

      Creates an immutable copy of a `JPRATypeModelType.JPRAVectorType` 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 JPRAVector instance

Copyright © 2016 <code@io7m.com> http://io7m.com