com.io7m.jtensors.bytebuffered.parameterized

## Class PVectorByteBufferedM2F<T>

- java.lang.Object
- - com.io7m.jtensors.bytebuffered.ByteBuffered
  - - com.io7m.jtensors.bytebuffered.parameterized.PVectorByteBufferedM2F<T>

- Type Parameters:
    `T` - A phantom type parameter
  All Implemented Interfaces:
    ByteBufferedType, PVectorByteBuffered2FType<T>, PVector2FType<T>, PVectorReadable2FType<T>, PVectorWritable2FType<T>, Vector2FType, VectorReadable2FType, VectorWritable2FType

      public final class PVectorByteBufferedM2F<T>
      extends ByteBuffered
      implements PVectorByteBuffered2FType<T>

  A two-element vector type with `float` elements, packed into a `ByteBuffer`.

  Values of this type cannot be accessed safely from multiple threads without explicit synchronization.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `copyFrom2F(VectorReadable2FType in_v)` Set the current vector to the contents of the input vector.
    `void` | `copyFromTyped2F(PVectorReadable2FType<T> in_v)` Set the current vector to the contents of the input vector.
    `boolean` | `equals(Object obj)`
    `float` | `getXF()`
    `float` | `getYF()`
    `int` | `hashCode()`
    `static <T> PVectorByteBuffered2FType<T>` | `newVectorFromByteBuffer(ByteBuffer b, long byte_offset)` Return a new vector that is backed by whatever data is at byte offset `byte_offset` in the byte buffer .
    `static <T> PVectorByteBuffered2FType<T>` | `newVectorFromByteBufferAndBase(ByteBuffer b, AtomicLong base, int offset)` Return a new vector that is backed by the given byte buffer `b`
    `void` | `set2F(float x, float y)` Set the current `x` and `y` values of the current vector.
    `void` | `setXF(float x)` Set the current `x` value of the current vector.
    `void` | `setYF(float y)` Set the current `y` value of the current vector.
    `String` | `toString()`

    - ### Methods inherited from class com.io7m.jtensors.bytebuffered.ByteBuffered

      `getByteOffset, getIndex, getOffset, setBase, setByteOffset`

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

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

    - ### Methods inherited from interface com.io7m.jtensors.bytebuffered.ByteBufferedType

      `getByteOffset, setByteOffset`

- - ### Method Detail

    - #### newVectorFromByteBuffer

          public static <T> PVectorByteBuffered2FType<T> newVectorFromByteBuffer(ByteBuffer b,
                                                                                 long byte_offset)

      Return a new vector that is backed by whatever data is at byte offset `byte_offset` in the byte buffer .

      No initialization of the data is performed.

      Type Parameters:
        `T` - A phantom type parameter
      Parameters:
        `b` - The byte buffer
        `byte_offset` - A byte offset
      Returns:
        A new buffered vector

    - #### newVectorFromByteBufferAndBase

          public static <T> PVectorByteBuffered2FType<T> newVectorFromByteBufferAndBase(ByteBuffer b,
                                                                                        AtomicLong base,
                                                                                        int offset)

      Return a new vector that is backed by the given byte buffer `b`

      The data for the instance will be taken from the data at the current value of `base.get() + offset`, each time a field is requested or set.

      No initialization of the data is performed.

      Type Parameters:
        `T` - A phantom type parameter
      Parameters:
        `b` - The byte buffer
        `base` - The base address
        `offset` - A constant offset
      Returns:
        A new buffered vector

    - #### getXF

          public float getXF()

      Specified by:
        `getXF` in interface `VectorReadable2FType`
      Returns:
        The X value of the given vector.

    - #### setXF

          public void setXF(float x)

      Description copied from interface: `VectorWritable2FType`
      Set the current `x` value of the current vector.
      Specified by:
        `setXF` in interface `VectorWritable2FType`
      Parameters:
        `x` - The new `x` value.

    - #### getYF

          public float getYF()

      Specified by:
        `getYF` in interface `VectorReadable2FType`
      Returns:
        The Y value of the given vector.

    - #### setYF

          public void setYF(float y)

      Description copied from interface: `VectorWritable2FType`
      Set the current `y` value of the current vector.
      Specified by:
        `setYF` in interface `VectorWritable2FType`
      Parameters:
        `y` - The new `y` value.

    - #### copyFrom2F

          public void copyFrom2F(VectorReadable2FType in_v)

      Description copied from interface: `VectorWritable2FType`
      Set the current vector to the contents of the input vector.
      Specified by:
        `copyFrom2F` in interface `VectorWritable2FType`
      Parameters:
        `in_v` - The input vector

    - #### set2F

          public void set2F(float x,
                            float y)

      Description copied from interface: `VectorWritable2FType`
      Set the current `x` and `y` values of the current vector.
      Specified by:
        `set2F` in interface `VectorWritable2FType`
      Parameters:
        `x` - The new `x` value.
        `y` - The new `y` value.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### copyFromTyped2F

          public void copyFromTyped2F(PVectorReadable2FType<T> in_v)

      Description copied from interface: `PVectorWritable2FType`
      Set the current vector to the contents of the input vector.
      Specified by:
        `copyFromTyped2F` in interface `PVectorWritable2FType<T>`
      Parameters:
        `in_v` - The input vector

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