de.caff.generics.mda

## Interface TwoDimensionalIntReadAccess

- All Superinterfaces:
    MultiDimensional, MultiDimensionalReadAccess<java.lang.Integer>, TwoDimensionalReadAccess<java.lang.Integer>
  All Known Subinterfaces:
    TwoDimensionalIntAccess
  All Known Implementing Classes:
    SmallTwoDimensionalIntArray, TwoDimensionalIntArray, TwoDimensionalIntReadAccess.Base

      public interface TwoDimensionalIntReadAccess
      extends TwoDimensionalReadAccess<java.lang.Integer>

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `TwoDimensionalIntReadAccess.Base` Base class implementing this interface which provides useful default methods for `Object.toString()`, `Object.equals(Object)`, and `Object.hashCode()`.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TwoDimensionalIntReadAccess` | `EMPTY` Empty 2dimensional int 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
    --- | ---
    `default TwoDimensionalIntReadAccess.Base` | `asBase()` Get a view of this 2-dimensional access which provides useful defaults for standard object methods.
    `default java.lang.Integer` | `getElementAt(int ix, int iy)` Get the element at the given indexes.
    `int` | `getValueAt(int ix, int iy)` Get the value at the given indexes.
    `static TwoDimensionalIntReadAccess` | `singleton(int singleElement)` Get a 2dimensional int read access for a single element.
    `default OneDimensionalIntReadAccess` | `subAtX(int ix)` Get a 1-dimensional view of the row at the given X index.
    `default OneDimensionalIntReadAccess` | `subAtY(int iy)` Get a 1-dimensional view of the column at the given X index.
    `default TwoDimensionalIntReadAccess` | `transposed()` Get a transposed view of this 2-dimensional read access.

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

      `empty, equal, getElement, getNumDimensions, getNumElements, getSize, getSizes, hash, sizeX, sizeY, toString, view, visitAll, visitAll, xIterable, xIterator, yIterable, yIterator`

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

      `empty, linearized`

- - ### Field Detail

    - #### EMPTY

          static final TwoDimensionalIntReadAccess EMPTY

      Empty 2dimensional int read access.

  - ### Method Detail

    - #### getValueAt

          int getValueAt(int ix,
                         int iy)

      Get the value at the given indexes.
      Parameters:
        `ix` - X index
        `iy` - Y index
      Returns:
        value at the given index

    - #### getElementAt

          @NotNull
          default java.lang.Integer getElementAt(int ix,
                                                          int iy)

      Description copied from interface: `TwoDimensionalReadAccess`
      Get the element at the given indexes.
      Specified by:
        `getElementAt` in interface `TwoDimensionalReadAccess<java.lang.Integer>`
      Parameters:
        `ix` - index in X direction from `0` (included) to `TwoDimensionalReadAccess.sizeX()` (excluded)
        `iy` - index in Y direction from `0` (included) to `TwoDimensionalReadAccess.sizeY()` (excluded)
      Returns:
        element at the given indexes

    - #### subAtX

          @NotNull
          default OneDimensionalIntReadAccess subAtX(int ix)

      Description copied from interface: `TwoDimensionalReadAccess`
      Get a 1-dimensional view of the row at the given X index. This is a view, so setting elements will change values in this array.
      Specified by:
        `subAtX` in interface `TwoDimensionalReadAccess<java.lang.Integer>`
      Parameters:
        `ix` - X index
      Returns:
        1-dimensional array at `ix`

    - #### subAtY

          @NotNull
          default OneDimensionalIntReadAccess subAtY(int iy)

      Description copied from interface: `TwoDimensionalReadAccess`
      Get a 1-dimensional view of the column at the given X index. This is a view, so setting elements will change values in this array.
      Specified by:
        `subAtY` in interface `TwoDimensionalReadAccess<java.lang.Integer>`
      Parameters:
        `iy` - Y index
      Returns:
        1-dimensional array at `iy`

    - #### transposed

          @NotNull
          default TwoDimensionalIntReadAccess transposed()

      Description copied from interface: `TwoDimensionalReadAccess`
      Get a transposed view of this 2-dimensional read access.
      Specified by:
        `transposed` in interface `TwoDimensionalReadAccess<java.lang.Integer>`
      Returns:
        transposed view where X and Y are interchanged

    - #### asBase

          @NotNull
          default TwoDimensionalIntReadAccess.Base asBase()

      Get a view of this 2-dimensional access which provides useful defaults for standard object methods.
      Specified by:
        `asBase` in interface `TwoDimensionalReadAccess<java.lang.Integer>`
      Returns:
        base view of this object

    - #### singleton

          @NotNull
          static TwoDimensionalIntReadAccess singleton(int singleElement)

      Get a 2dimensional int read access for a single element.
      Specified by:
        `singleton` in interface `TwoDimensionalReadAccess<java.lang.Integer>`
      Parameters:
        `singleElement` - single element
      Returns:
        2dimensional int read access with size 1 in both directions, containing just the given single element