de.caff.generics.mda

## Class MultiIndexLinearizer.BasicSequencer

- java.lang.Object
- - de.caff.generics.mda.MultiIndexLinearizer.BasicSequencer

- All Implemented Interfaces:
    Countable<int[]>, Indexable<int[]>, MultiDimensional, MultiIndexLinearizer.Sequencer, Sizeable, java.lang.Iterable<int[]>
  Enclosing interface:
    MultiIndexLinearizer

      public abstract static class MultiIndexLinearizer.BasicSequencer
      extends java.lang.Object
      implements MultiIndexLinearizer.Sequencer

  Basic implementation of a Sequencer.

  This provides everything but the actual sequencing.

- - ### Nested Class Summary

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

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

  - ### Field Summary

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

      `EMPTY, EMPTY_INDEXABLE_STRING`

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

      `NULL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicSequencer(MultiIndexLinearizer indexLinearizer)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `get(int index)` Get the element at the given index.
    `protected abstract int[]` | `get(int index, int[] sizes)` Get the multi-indexes for the given sequence index.
    `int` | `getNumDimensions()` Get the number of dimensions used by this access,
    `long` | `getNumElements()` Get the combined number of elements in all dimensions.
    `int` | `getSize(int dim)` Get the size of the given dimension.
    `int[]` | `getSizes()` Get the sizes of the dimensions of this access.
    `int` | `size()` Get the size.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

      `addToArray, addToArray, addToCollection, asBase, 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, getMod, gyt, hash, headSet, indexedView, indexes, init, initByIndex, initFragile, intIndexes, isEmpty, isOrdered, isStrictlyOrdered, iterator, iterator, last, listIterator, mapArray, optional, ordered, reverse, rotated, singleton, 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, empty, 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`

- - ### Constructor Detail

    - #### BasicSequencer

          public BasicSequencer(@NotNull
                                MultiIndexLinearizer indexLinearizer)

      Constructor.
      Parameters:
        `indexLinearizer` - multi-index linearizer on which this sequencer operates

  - ### Method Detail

    - #### getNumDimensions

          public 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

          public 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

    - #### getNumElements

          public 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

    - #### getSizes

          @NotNull
          public 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()`

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

          @NotNull
          public int[] get(int index)

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

    - #### get

          @NotNull
          protected abstract int[] get(int index,
                                                @NotNull
                                                int[] sizes)

      Get the multi-indexes for the given sequence index.
      Parameters:
        `index` - linear sequence index between `0` (included) and `getNumElements()` (excluded)
        `sizes` - sizes of the dimensions (do not change!)
      Returns:
        multi-indexes for access the `index`th element