com.io7m.jpra.runtime.java

## Class JPRACursor1DByteBufferedUnchecked<T extends JPRAValueType>

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

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

      public final class JPRACursor1DByteBufferedUnchecked<T extends JPRAValueType>
      extends Object
      implements JPRACursor1DType<T>

  A 1D 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
    --- | ---
    `AtomicLong` | `getByteOffsetObservable()`
    `int` | `getElementIndex()`
    `T` | `getElementView()`
    `static <T extends JPRAValueType> JPRACursor1DType<T>` | `newCursor(ByteBuffer in_buffer, JPRAValueByteBufferedConstructorType<T> in_cons)` Construct a new cursor, assuming that the given buffer contains elements of type `T`.
    `void` | `setElementIndex(int new_index)` Point the cursor at element `index` 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> JPRACursor1DType<T> newCursor(ByteBuffer in_buffer,
                                                                                JPRAValueByteBufferedConstructorType<T> in_cons)

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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getElementIndex

          public int getElementIndex()

      Specified by:
        `getElementIndex` in interface `JPRACursor1DType<T extends JPRAValueType>`
      Returns:
        The current element index

    - #### setElementIndex

          public void setElementIndex(int new_index)
                               throws IndexOutOfBoundsException

      Description copied from interface: `JPRACursor1DType`

      Point the cursor at element `index` of the array.

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

      Specified by:
        `setElementIndex` in interface `JPRACursor1DType<T extends JPRAValueType>`
      Parameters:
        `new_index` - The index
      Throws:
        `IndexOutOfBoundsException` - Iff the implementation performs bounds checking and the index is out of range

    - #### 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 AtomicLong getByteOffsetObservable()

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

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