com.io7m.jtensors.bytebuffered

## Class VectorByteBufferedM3D

- java.lang.Object
- - com.io7m.jtensors.bytebuffered.ByteBuffered
  - - com.io7m.jtensors.bytebuffered.VectorByteBufferedM3D

- All Implemented Interfaces:
    ByteBufferedType, VectorByteBuffered2DType, VectorByteBuffered3DType, Vector2DType, Vector3DType, VectorReadable2DType, VectorReadable3DType, VectorWritable2DType, VectorWritable3DType

      public final class VectorByteBufferedM3D
      extends ByteBuffered
      implements VectorByteBuffered3DType

  A three-element vector type with `double` 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` | `copyFrom2D(VectorReadable2DType in_v)` Set the current vector to the contents of the input vector.
    `void` | `copyFrom3D(VectorReadable3DType in_v)` Set the current vector to the contents of the input vector.
    `boolean` | `equals(Object obj)`
    `double` | `getXD()`
    `double` | `getYD()`
    `double` | `getZD()`
    `int` | `hashCode()`
    `static VectorByteBuffered3DType` | `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 VectorByteBuffered3DType` | `newVectorFromByteBufferAndBase(ByteBuffer b, AtomicLong base, int offset)` Return a new vector that is backed by the given byte buffer `b`
    `void` | `set2D(double x, double y)` Set the current `x` and `y` values of the current vector.
    `void` | `set3D(double x, double y, double z)` Set the current `x`, `y` and `z` values of the current vector.
    `void` | `setXD(double x)` Set the current `x` value of the current vector.
    `void` | `setYD(double y)` Set the current `y` value of the current vector.
    `void` | `setZD(double z)` Set the current `z` 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 VectorByteBuffered3DType 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.

      Parameters:
        `b` - The byte buffer
        `byte_offset` - A byte offset
      Returns:
        A new buffered vector

    - #### newVectorFromByteBufferAndBase

          public static VectorByteBuffered3DType 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.

      Parameters:
        `b` - The byte buffer
        `base` - The base address
        `offset` - A constant offset
      Returns:
        A new buffered vector

    - #### getZD

          public double getZD()

      Specified by:
        `getZD` in interface `VectorReadable3DType`
      Returns:
        The Z value of the given vector.

    - #### setZD

          public void setZD(double z)

      Description copied from interface: `VectorWritable3DType`
      Set the current `z` value of the current vector.
      Specified by:
        `setZD` in interface `VectorWritable3DType`
      Parameters:
        `z` - The new `z` value.

    - #### getXD

          public double getXD()

      Specified by:
        `getXD` in interface `VectorReadable2DType`
      Returns:
        The X value of the given vector.

    - #### setXD

          public void setXD(double x)

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

    - #### getYD

          public double getYD()

      Specified by:
        `getYD` in interface `VectorReadable2DType`
      Returns:
        The Y value of the given vector.

    - #### setYD

          public void setYD(double y)

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

    - #### copyFrom3D

          public void copyFrom3D(VectorReadable3DType in_v)

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

    - #### set3D

          public void set3D(double x,
                            double y,
                            double z)

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

    - #### copyFrom2D

          public void copyFrom2D(VectorReadable2DType in_v)

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

    - #### set2D

          public void set2D(double x,
                            double y)

      Description copied from interface: `VectorWritable2DType`
      Set the current `x` and `y` values of the current vector.
      Specified by:
        `set2D` in interface `VectorWritable2DType`
      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`

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