de.caff.generics.mda

## Interface ThreeDimensionalReadAccess<T>

- All Superinterfaces:
    MultiDimensional, MultiDimensionalReadAccess<T>
  All Known Subinterfaces:
    ThreeDimensionalAccess<T>, ThreeDimensionalBooleanAccess, ThreeDimensionalBooleanReadAccess, ThreeDimensionalByteAccess, ThreeDimensionalByteReadAccess, ThreeDimensionalCharAccess, ThreeDimensionalCharReadAccess, ThreeDimensionalDoubleAccess, ThreeDimensionalDoubleReadAccess, ThreeDimensionalFloatAccess, ThreeDimensionalFloatReadAccess, ThreeDimensionalIntAccess, ThreeDimensionalIntReadAccess, ThreeDimensionalLongAccess, ThreeDimensionalLongReadAccess, ThreeDimensionalShortAccess, ThreeDimensionalShortReadAccess
  All Known Implementing Classes:
    ThreeDimensionalArray, ThreeDimensionalBooleanArray, ThreeDimensionalByteArray, ThreeDimensionalCharArray, ThreeDimensionalDoubleArray, ThreeDimensionalFloatArray, ThreeDimensionalIntArray, ThreeDimensionalLongArray, ThreeDimensionalShortArray

      public interface ThreeDimensionalReadAccess<T>
      extends MultiDimensionalReadAccess<T>

  Read access for 3-dimensional rectangular arrays.
  Since:
    November 11, 2019
  Author:
    Rammi

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ThreeDimensionalReadAccess<?>` | `EMPTY` Empty 3dimensional read access.

    - ### Fields inherited from interface de.caff.generics.mda.MultiDimensionalReadAccess

      `EMPTY0, EMPTY1, EMPTY2, EMPTY3, EMPTY4, EMPTY5, EMPTY6, EMPTY7`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <E> ThreeDimensionalReadAccess<E>` | `empty()` Get an empty 3dimensional read access.
    `default T` | `getElement(int... indexes)` Get the element located at the given indexes.
    `T` | `getElementAt(int ix, int iy, int iz)` Get the element at the given indexes.
    `default int` | `getNumDimensions()` Get the number of dimensions used by this access,
    `default long` | `getNumElements()` Get the combined number of elements in all dimensions.
    `default int` | `getSize(int dim)` Get the size of the given dimension.
    `default int[]` | `getSizes()` Get the sizes of the dimensions of this access.
    `static <E> ThreeDimensionalReadAccess<E>` | `singleton(E singleElement)` Get a 3dimensional read access for a single element.
    `int` | `sizeX()` Get the number of elements in X direction.
    `int` | `sizeY()` Get the number of elements in Y direction
    `int` | `sizeZ()` Get the number of elements in Z direction
    `default TwoDimensionalReadAccess<T>` | `subAtX(int fixX)` Get a 2-dimensional view of the plane at the given X index.
    `default TwoDimensionalReadAccess<T>` | `subAtY(int fixY)` Get a 2-dimensional view of the plane at the given Y index.
    `default TwoDimensionalReadAccess<T>` | `subAtZ(int fixZ)` Get a 2-dimensional view of the plane at the given Z index.
    `default <TOUT> ThreeDimensionalReadAccess<TOUT>` | `view(Function1<TOUT,T> conv)` Get a view of this two dimensional array with converted elements.
    `default void` | `visitAll(Procedure1<? super T> visitor)` Visit all elements in this multi-dimensional array.
    `default void` | `visitAll(Procedure2<? super T,int[]> visitor)` Visit all elements of this multi-dimensional array.

    - ### Methods inherited from interface de.caff.generics.mda.MultiDimensionalReadAccess

      `empty, linearized`

- - ### Field Detail

    - #### EMPTY

          static final ThreeDimensionalReadAccess<?> EMPTY

      Empty 3dimensional read access. Use `empty()` instead.

  - ### Method Detail

    - #### sizeX

          int sizeX()

      Get the number of elements in X direction.
      Returns:
        number of elements in X direction

    - #### sizeY

          int sizeY()

      Get the number of elements in Y direction
      Returns:
        number of elements in Y direction

    - #### sizeZ

          int sizeZ()

      Get the number of elements in Z direction
      Returns:
        number of elements in Z direction

    - #### getElementAt

          T getElementAt(int ix,
                         int iy,
                         int iz)

      Get the element at the given indexes.
      Parameters:
        `ix` - index in X direction from `0` (included) to `sizeX()` (excluded)
        `iy` - index in Y direction from `0` (included) to `sizeY()` (excluded)
        `iz` - index in Z direction from `0` (included) to `sizeZ()` (excluded)
      Returns:
        element at the given indexes

    - #### getElement

          default T getElement(int... indexes)

      Description copied from interface: `MultiDimensionalReadAccess`
      Get the element located at the given indexes.
      Specified by:
        `getElement` in interface `MultiDimensionalReadAccess<T>`
      Parameters:
        `indexes` - `MultiDimensional.getNumDimensions()` indexes inside the bounds defined by `MultiDimensional.getSizes()`
      Returns:
        element located at the given indexes

    - #### subAtX

          @NotNull
          default TwoDimensionalReadAccess<T> subAtX(int fixX)

      Get a 2-dimensional view of the plane at the given X index. This is a view, so setting elements will change values in this array.
      Parameters:
        `fixX` - fix X index
      Returns:
        2-dimensional array at `fixX`

    - #### subAtY

          @NotNull
          default TwoDimensionalReadAccess<T> subAtY(int fixY)

      Get a 2-dimensional view of the plane at the given Y index. This is a view, so setting elements will change values in this array.
      Parameters:
        `fixY` - fix Y index
      Returns:
        2-dimensional array at `fixY`

    - #### subAtZ

          @NotNull
          default TwoDimensionalReadAccess<T> subAtZ(int fixZ)

      Get a 2-dimensional view of the plane at the given Z index. This is a view, so setting elements will change values in this array.
      Parameters:
        `fixZ` - fix Z index
      Returns:
        2-dimensional array at `fixZ`

    - #### getNumDimensions

          default int getNumDimensions()

      Description copied from interface: `MultiDimensional`
      Get the number of dimensions used by this access,
      Specified by:
        `getNumDimensions` in interface `MultiDimensional`
      Returns:
        number of dimensions

    - #### getSize

          default int getSize(int dim)

      Description copied from interface: `MultiDimensional`
      Get the size of the given dimension.
      Specified by:
        `getSize` in interface `MultiDimensional`
      Parameters:
        `dim` - dimension, greater than `0` and less than `MultiDimensional.getNumDimensions()`
      Returns:
        number of elements in the given dimension

    - #### getSizes

          @NotNull
          default int[] getSizes()

      Description copied from interface: `MultiDimensional`
      Get the sizes of the dimensions of this access.
      Specified by:
        `getSizes` in interface `MultiDimensional`
      Returns:
        array of length `MultiDimensional.getNumDimensions()`

    - #### getNumElements

          default long getNumElements()

      Description copied from interface: `MultiDimensional`
      Get the combined number of elements in all dimensions.
      Specified by:
        `getNumElements` in interface `MultiDimensional`
      Returns:
        number of all elements in this multi-dimensional array

    - #### view

          @NotNull
          default <TOUT> ThreeDimensionalReadAccess<TOUT> view(@NotNull
                                                                        Function1<TOUT,T> conv)

      Get a view of this two dimensional array with converted elements.
      Type Parameters:
        `TOUT` - element type provided by the view
      Parameters:
        `conv` - element converter
      Returns:
        view of this array with converted elements

    - #### visitAll

          default void visitAll(@NotNull
                                Procedure2<? super T,int[]> visitor)

      Description copied from interface: `MultiDimensionalReadAccess`
      Visit all elements of this multi-dimensional array.
      Specified by:
        `visitAll` in interface `MultiDimensionalReadAccess<T>`
      Parameters:
        `visitor` - visitor called with an array element and its multi-index

    - #### visitAll

          default void visitAll(@NotNull
                                Procedure1<? super T> visitor)

      Description copied from interface: `MultiDimensionalReadAccess`
      Visit all elements in this multi-dimensional array.
      Specified by:
        `visitAll` in interface `MultiDimensionalReadAccess<T>`
      Parameters:
        `visitor` - element visitor called once with each element

    - #### empty

          @NotNull
          static <E> ThreeDimensionalReadAccess<E> empty()

      Get an empty 3dimensional read access.
      Type Parameters:
        `E` - element type
      Returns:
        `EMPTY` in a form the compiler accepts

    - #### singleton

          @NotNull
          static <E> ThreeDimensionalReadAccess<E> singleton(E singleElement)

      Get a 3dimensional read access for a single element.
      Type Parameters:
        `E` - element type
      Parameters:
        `singleElement` - single element
      Returns:
        2dimensional read access with size 1 in all 3 directions, containing just the given single element