com.io7m.jpra.runtime.java

## Class JPRACursor2DByteBufferedUnchecked<T extends JPRAValueType>

- java.lang.Object
- - com.io7m.jpra.runtime.java.JPRACursor2DByteBufferedUnchecked<T>

- Type Parameters:
    `T` - The type of addressed values
  All Implemented Interfaces:
    JPRACursor2DType<T>, JPRACursorByteReadableType, JPRACursorType<T>

      public final class JPRACursor2DByteBufferedUnchecked<T extends JPRAValueType>
      extends Object
      implements JPRACursor2DType<T>

  A 2D cursor implementation that addresses values within a `ByteBuffer` and does not perform bounds checking.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.io7m.mutable.numbers.core.MutableLongType` | `getByteOffsetObservable()`
    `T` | `getElementView()`
    `int` | `getElementX()`
    `int` | `getElementY()`
    `static <T extends JPRAValueType> JPRACursor2DType<T>` | `newCursor(ByteBuffer in_buffer, int width, int height, JPRAValueByteBufferedConstructorType<T> in_cons)` Construct a new cursor, assuming that the given buffer contains a `width * height` region of elements of type `T`.
    `void` | `setElementPosition(int in_x, int in_y)` Point the cursor at element `(x, y)` of the array.
    `String` | `toString()`

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

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

- - ### Method Detail

    - #### newCursor

          public static <T extends JPRAValueType> JPRACursor2DType<T> newCursor(ByteBuffer in_buffer,
                                                                                int width,
                                                                                int height,
                                                                                JPRAValueByteBufferedConstructorType<T> in_cons)

      Construct a new cursor, assuming that the given buffer contains a `width * height` region of elements of type `T`.
      Type Parameters:
        `T` - The precise type of elements
      Parameters:
        `in_buffer` - The byte buffer
        `width` - The width of the region
        `height` - The height of the region
        `in_cons` - An element value constructor
      Returns:
        A new cursor

    - #### getElementView

          public T getElementView()

      Specified by:
        `getElementView` in interface `JPRACursorType<T extends JPRAValueType>`
      Returns:
        A view of the current element, updated whenever the cursor position changes

    - #### getByteOffsetObservable

          public com.io7m.mutable.numbers.core.MutableLongType getByteOffsetObservable()

      Specified by:
        `getByteOffsetObservable` in interface `JPRACursorByteReadableType`
      Returns:
        The current byte offset

    - #### getElementX

          public int getElementX()

      Specified by:
        `getElementX` in interface `JPRACursor2DType<T extends JPRAValueType>`
      Returns:
        The current element `x` position

    - #### getElementY

          public int getElementY()

      Specified by:
        `getElementY` in interface `JPRACursor2DType<T extends JPRAValueType>`
      Returns:
        The current element `y` position

    - #### setElementPosition

          public void setElementPosition(int in_x,
                                         int in_y)
                                  throws IndexOutOfBoundsException

      Description copied from interface: `JPRACursor2DType`

      Point the cursor at element `(x, y)` of the array.

      Implementations are permitted to perform bounds checking, and must throw `IndexOutOfBoundsException` on out-of-bounds indices.

      Specified by:
        `setElementPosition` in interface `JPRACursor2DType<T extends JPRAValueType>`
      Parameters:
        `in_x` - The `x` (horizontal, columns) position
        `in_y` - The `y` (vertical, rows) position
      Throws:
        `IndexOutOfBoundsException` - Iff the implementation performs bounds checking and the element is out of range

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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