de.caff.generics.mda

## Interface OneDimensionalReadAccess<T>

- All Superinterfaces:
    Countable<T>, Indexable<T>, java.lang.Iterable<T>, MultiDimensional, MultiDimensionalReadAccess<T>, Sizeable
  All Known Subinterfaces:
    OneDimensionalAccess<T>, OneDimensionalBooleanAccess, OneDimensionalBooleanReadAccess, OneDimensionalByteAccess, OneDimensionalByteReadAccess, OneDimensionalCharAccess, OneDimensionalCharReadAccess, OneDimensionalDoubleAccess, OneDimensionalDoubleReadAccess, OneDimensionalFloatAccess, OneDimensionalFloatReadAccess, OneDimensionalIntAccess, OneDimensionalIntReadAccess, OneDimensionalLongAccess, OneDimensionalLongReadAccess, OneDimensionalShortAccess, OneDimensionalShortReadAccess
  All Known Implementing Classes:
    OneDimensionalArray, OneDimensionalBooleanArray, OneDimensionalBooleanReadAccess.Base, OneDimensionalByteArray, OneDimensionalByteReadAccess.Base, OneDimensionalCharArray, OneDimensionalCharReadAccess.Base, OneDimensionalDoubleArray, OneDimensionalDoubleReadAccess.Base, OneDimensionalFloatArray, OneDimensionalFloatReadAccess.Base, OneDimensionalIntArray, OneDimensionalIntReadAccess.Base, OneDimensionalLongArray, OneDimensionalLongReadAccess.Base, OneDimensionalReadAccess.Base, OneDimensionalShortArray, OneDimensionalShortReadAccess.Base

      public interface OneDimensionalReadAccess<T>
      extends Indexable<T>, MultiDimensionalReadAccess<T>

  A one-dimensional read-only interface.
  Since:
    November 11, 2019
  Author:
    Rammi

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `OneDimensionalReadAccess.Base<TT>` Abstract base class which provides useful implementations for `Object.equals(Object)`, `Object.hashCode()`, `Object.toString()`.

    - ### Nested classes/interfaces inherited from interface de.caff.generics.Indexable

      `Indexable.IndexableSpliterator<TElem>, Indexable.ListView<T>`

  - ### Field Summary

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

    - ### Fields inherited from interface de.caff.generics.Indexable

      `EMPTY_INDEXABLE_STRING`

    - ### Fields inherited from interface de.caff.generics.Sizeable

      `NULL`

    - ### 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 Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default OneDimensionalReadAccess.Base<T>` | `asBase()` Make this read access usable as a base class with default Object methods implemented.
    `default OneDimensionalReadAccess<T>` | `copy()` Get an independent copy.
    `static <E> OneDimensionalReadAccess<E>` | `empty()` Get an empty 1dimensional read access.
    `default T` | `getElement(int... indexes)` Get the element located 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> OneDimensionalReadAccess<E>` | `singleton(E singleElement)` Get a 1dimensional read access for a single element
    `default <TOUT> OneDimensionalReadAccess<TOUT>` | `view(Function1<TOUT,? super T> conv)` Get a view of this 1-dimensional access 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.Indexable

      `addToArray, addToArray, addToCollection, asCollection, asList, binarySearch, checkIndex, combine, compare, downCast, emptyIndexable, equal, findAll, findAllX, findFirst, findFirst, findFirst, findFirstX, findLast, findLast, findLast, findNext, findNext, findNext, findNextX, findPrevious, findPrevious, findPrevious, first, firstMatch, firstMatch, firstMatchX, forEachEntry, forEachEntryFragile, fromArray, fromCollection, fromCollection, fromCountable, fromCountable, fromEnumeration, fromEnumeration, fromIterable, fromIterable, fromIterable, fromIterable, fromIterator, fromList, fromOptional, frozenSpliterator, get, getMod, gyt, hash, headSet, indexedView, indexes, init, initByIndex, initFragile, intIndexes, isEmpty, isOrdered, isStrictlyOrdered, iterator, iterator, last, listIterator, mapArray, optional, ordered, reverse, rotated, spliterator, subSet, sybSet, tailSet, toString, view, view, viewArray, viewArray, viewAsBooleanIndexable, viewAsByteIndexable, viewAsCharIndexable, viewAsDict, viewAsDoubleIndexable, viewAsFloatIndexable, viewAsIntIndexable, viewAsLongIndexable, viewAsShortIndexable, viewByIndex, viewFragile, viewList, viewList, viewListN, viewListN, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, viewTuple, withAppendedItem, withCachedHash, withExchangedItemAt, withInsertedItemAt, withPrependedItem, withRemovedItemAt, withSwappedItemsAt`

    - ### Methods inherited from interface de.caff.generics.Countable

      `addAllTo, combined, combined, containsEq, containsRef, downCast, equal, equals, filtered, filteredToIndexable, filterToCountable, firstOrNull, foldLeft, forEachFragile, freeze, frozen, frozen, getAny, groupingBy, groupingBy, hasAll, hasAny, isSorted, isStrictlySorted, lastOrNull, mappingBy, mappingBy, optFirst, optLast, orderedCombination, parellelStream, sorted, stream, toArray, toArray, toList, toString, uniform, viewCollection, viewCollection, viewCollectionN, viewCollectionN`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

    - ### Methods inherited from interface de.caff.generics.Sizeable

      `size`

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

      `empty, linearized`

- - ### Field Detail

    - #### EMPTY

          static final OneDimensionalReadAccess<?> EMPTY

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

  - ### Method Detail

    - #### 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

    - #### 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

    - #### copy

          @NotNull
          default OneDimensionalReadAccess<T> copy()

      Get an independent copy.
      Returns:
        indpendent copy

    - #### view

          @NotNull
          default <TOUT> OneDimensionalReadAccess<TOUT> view(@NotNull
                                                                      Function1<TOUT,? super T> conv)

      Get a view of this 1-dimensional access with converted elements.
      Type Parameters:
        `TOUT` - element type of the returned view
      Parameters:
        `conv` - converted applied to the elements
      Returns:
        view of this 1-dimensional read access 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

    - #### asBase

          @NotNull
          default OneDimensionalReadAccess.Base<T> asBase()

      Make this read access usable as a base class with default Object methods implemented.
      Specified by:
        `asBase` in interface `Countable<T>`
      Specified by:
        `asBase` in interface `Indexable<T>`
      Returns:
        base version of this access

    - #### empty

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

      Get an empty 1dimensional read access.
      Specified by:
        `empty` in interface `Countable<T>`
      Type Parameters:
        `E` - element type
      Returns:
        `EMPTY` in a form the compiler accepts

    - #### singleton

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

      Get a 1dimensional read access for a single element
      Specified by:
        `singleton` in interface `Countable<T>`
      Specified by:
        `singleton` in interface `Indexable<T>`
      Type Parameters:
        `E` - element type
      Parameters:
        `singleElement` - single element
      Returns:
        1dimensional read access with size 1, containing just the given single element