de.caff.generics.mda

## Class OneDimensionalArray<T>

- java.lang.Object
- - de.caff.generics.Countable.Base<TT>
  - - de.caff.generics.Indexable.Base<TT>
    - - de.caff.generics.mda.OneDimensionalReadAccess.Base<T>
      - - de.caff.generics.mda.OneDimensionalArray<T>

- All Implemented Interfaces:
    Countable<T>, Indexable<T>, MultiDimensional, MultiDimensionalAccess<T>, MultiDimensionalReadAccess<T>, OneDimensionalAccess<T>, OneDimensionalReadAccess<T>, MutableIndexable<T>, Sizeable, java.lang.Iterable<T>

      public class OneDimensionalArray<T>
      extends OneDimensionalReadAccess.Base<T>
      implements OneDimensionalAccess<T>

  Standard implementation for a 1-dimensional access.
  Since:
    November 11, 2019
  Author:
    Rammi

- - ### Nested Class Summary

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

      `MutableIndexable.Base<TT>, MutableIndexable.ListView<T>`

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

      `OneDimensionalReadAccess.Base<TT>`

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

      `Indexable.IndexableSpliterator<TElem>`

  - ### Field Summary

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

      `EMPTY`

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OneDimensionalArray(java.util.Collection<T> elements)` Constructor.
    `OneDimensionalArray(Indexable<T> elements)` Constructor.
    `OneDimensionalArray(int size)` Constructor.
    `OneDimensionalArray(int size, java.util.function.IntFunction<? extends T> filler)` Initializing Constructor.
    `OneDimensionalArray(java.lang.Iterable<T> elements)` Constructor.
    `OneDimensionalArray(T... elements)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `OneDimensionalAccess<T>` | `copy()` Get an independent copy.
    `T` | `get(int index)` Get the element at the given index.
    `void` | `set(int index, T elem)` Set the element at the given index.
    `int` | `size()` Get the size.

    - ### Methods inherited from class de.caff.generics.mda.OneDimensionalReadAccess.Base

      `asBase`

    - ### Methods inherited from class de.caff.generics.Countable.Base

      `equals, hashCode, toString`

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

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

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

      `changeAll, changeAll, empty, fillByIndex, setElement, setElementAt`

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

      `applyOnEach, asList, copy, copyInternally, copyOf, filled, fillFrom, fromArray, fromArray, fromIndexable, fromIndexable, fromIterable, getCopy, getCopy, headSet, init, initByIndex, initFragile, listIterator, nulled, order, reverse, revert, revert, setFrom, setFrom, setFromArray, setMulti, shuffle, subSet, swap, swyp, sybSet, syt, tailSet, viewArray, viewArray, viewIndexable, viewList`

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

      `change, setAll, setFrom, setFrom, setFrom`

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

      `asBase, getElement, getNumDimensions, getNumElements, getSize, getSizes, singleton, view, visitAll, visitAll`

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

      `addToArray, addToArray, addToCollection, asCollection, 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, fromCollection, fromCollection, fromCountable, fromCountable, fromEnumeration, fromEnumeration, fromIterable, fromIterable, fromIterable, fromIterable, fromIterator, fromList, fromOptional, frozenSpliterator, getMod, gyt, hash, indexedView, indexes, init, initByIndex, intIndexes, isEmpty, isOrdered, isStrictlyOrdered, iterator, iterator, last, mapArray, optional, ordered, rotated, spliterator, toString, view, view, 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.mda.MultiDimensionalReadAccess

      `empty, linearized`

- - ### Constructor Detail

    - #### OneDimensionalArray

          public OneDimensionalArray(@NotNull
                                     java.util.Collection<T> elements)

      Constructor.
      Parameters:
        `elements` - elements of this array

    - #### OneDimensionalArray

          public OneDimensionalArray(@NotNull
                                     Indexable<T> elements)

      Constructor.
      Parameters:
        `elements` - elements of this array

    - #### OneDimensionalArray

          public OneDimensionalArray(int size)

      Constructor. This will fill all elements with `null`.
      Parameters:
        `size` - size of this array

    - #### OneDimensionalArray

          public OneDimensionalArray(int size,
                                     @NotNull
                                     java.util.function.IntFunction<? extends T> filler)

      Initializing Constructor.
      Parameters:
        `size` - size of this array
        `filler` - filler which is called with for each element with its index and expected to return the value at that index

    - #### OneDimensionalArray

          @SafeVarargs
          public OneDimensionalArray(@NotNull
                                                  T... elements)

      Constructor.
      Parameters:
        `elements` - elements of this array

    - #### OneDimensionalArray

          public OneDimensionalArray(@NotNull
                                     java.lang.Iterable<T> elements)

      Constructor.
      Parameters:
        `elements` - elements of this array.

  - ### Method Detail

    - #### copy

          @NotNull
          public OneDimensionalAccess<T> copy()

      Description copied from interface: `OneDimensionalAccess`
      Get an independent copy.
      Specified by:
        `copy` in interface `OneDimensionalAccess<T>`
      Specified by:
        `copy` in interface `OneDimensionalReadAccess<T>`
      Returns:
        independent copy

    - #### set

          public void set(int index,
                          T elem)

      Description copied from interface: `MutableIndexable`
      Set the element at the given index.
      Specified by:
        `set` in interface `MutableIndexable<T>`
      Parameters:
        `index` - index between `0` and `size() - 1`
        `elem` - element to put to the given index

    - #### size

          public int size()

      Description copied from interface: `Sizeable`
      Get the size. Size is never negative.
      Specified by:
        `size` in interface `Sizeable`
      Returns:
        the size of this object, usually the number of contained elements, must not be negative

    - #### get

          public T get(int index)

      Description copied from interface: `Indexable`
      Get the element at the given index.
      Specified by:
        `get` in interface `Indexable<T>`
      Parameters:
        `index` - index between `0` and `size() - 1`
      Returns:
        element at the given index