de.caff.generics

## Interface MutableIndexable<T>

- All Superinterfaces:
    Countable<T>, Indexable<T>, java.lang.Iterable<T>, Sizeable
  All Known Subinterfaces:
    OneDimensionalAccess<T>, OneDimensionalBooleanAccess, OneDimensionalByteAccess, OneDimensionalCharAccess, OneDimensionalDoubleAccess, OneDimensionalFloatAccess, OneDimensionalIntAccess, OneDimensionalLongAccess, OneDimensionalShortAccess
  All Known Implementing Classes:
    MutableIndexable.Base, OneDimensionalArray, OneDimensionalBooleanArray, OneDimensionalByteArray, OneDimensionalCharArray, OneDimensionalDoubleArray, OneDimensionalFloatArray, OneDimensionalIntArray, OneDimensionalLongArray, OneDimensionalShortArray

      public interface MutableIndexable<T>
      extends Indexable<T>

  Indexable with fixed length but mutable content.
  Since:
    November 01, 2019
  Author:
    Rammi

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `MutableIndexable.Base<TT>` Abstract base class which provides useful implementations for `Object.equals(Object)`, `Object.hashCode()`, `Object.toString()`.
    `static class` | `MutableIndexable.ListView<T>` Helper class for viewing a mutable indexable as a standard list.

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

      `Indexable.IndexableSpliterator<TElem>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static MutableIndexable<java.lang.Object>` | `EMPTY` Empty mutable indexable.

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

      `EMPTY_INDEXABLE_STRING`

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

      `NULL`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `applyOnEach(java.util.function.Function<? super T,? extends T> operator)` Apply the given operator on each element.
    `default java.util.List<T>` | `asList()` View this indexable as a standard list.
    `static <E,IN> MutableIndexable<E>` | `copy(java.util.Collection<IN> collection, java.util.function.Function<IN,E> copier)` Create a mutable indexable which is initialized from copied elements of a given collection.
    `default void` | `copyInternally(int fromIndex, int toIndex, int numElements)` Copy elements inside this indexable.
    `static <E> MutableIndexable<E>` | `copyOf(java.util.Collection<E> collection)` Create a mutable indexable which is intialized from a given collection.
    `static <E> MutableIndexable<E>` | `empty()` Get an empty mutable indexable.
    `static <E> MutableIndexable<E>` | `filled(int size, java.util.function.IntFunction<? extends E> provider)` Deprecated. inconsistently named, use `initByIndex(int, IntFunction)` instead
    `default void` | `fillFrom(java.util.function.IntFunction<? extends T> provider)` Fill this indexable from a provider.
    `static <E> MutableIndexable<E>` | `fromArray(E... elements)` Create a mutable indexable which is initialized from elements of the given array.
    `static <E> MutableIndexable<E>` | `fromArray(E[] elements, int startIndex, int length)` Create a mutable indexable which is initialized from elements of the given array.
    `static <E,B> MutableIndexable<E>` | `fromIndexable(Indexable<B> indexable, java.util.function.Function<B,E> converter)` Create a mutable indexable which is the copy of a standard indexable.
    `static <E> MutableIndexable<E>` | `fromIndexable(Indexable<E> indexable)` Create a mutable indexable which is the copy of a standard indexable.
    `static <E> MutableIndexable<E>` | `fromIterable(int size, java.lang.Iterable<E> iter)` Create a mutable indexable from an iterable or a part of it.
    `default MutableIndexable<T>` | `getCopy()` Get a flat copy of this mutable indexable.
    `default MutableIndexable<T>` | `getCopy(java.util.function.Function<? super T,? extends T> elementCloner)` Get a copy of this object, allowing to define a copy method for the elements.
    `default MutableIndexable<T>` | `headSet(int toIndex)` Create an indexable subset from the last elements of this indexable set.
    `static <E> MutableIndexable<E>` | `init(int size, java.util.function.Supplier<E> creator)` Initialize a mutable indexable to a given size.
    `static <E> MutableIndexable<E>` | `initByIndex(int size, java.util.function.IntFunction<? extends E> producer)` Create a mutable indexable of a given size, and initialize its elements by index.
    `static <E,X extends java.lang.Exception> MutableIndexable<E>` | `initFragile(int size, FragileFunction0<E,X> creator)` Initialize a mutable indexable to a given size while allowing exceptions.
    `default java.util.ListIterator<T>` | `listIterator()` Overridden to allow setting via the returned iterator.
    `static <E> MutableIndexable<E>` | `nulled(int size)` Get a mutable indexable of a given size filled with `null` values.
    `default void` | `order(Ordering<? super T> ordering)` Order the elements in this indexable by the given ordering.
    `default MutableIndexable<T>` | `reverse()` Get this indexable but with inverted order.
    `default void` | `revert()` Revert the elements in this indexable.
    `default void` | `revert(int from, int to)` Revert the order of all elements in the given range.
    `void` | `set(int index, T elem)` Set the element at the given index.
    `default int` | `setFrom(java.lang.Iterable<? extends T> iterable)` Set the elements of this mutable indexable one after the other from the given iterable until either the iterable is emptied or `Sizeable.size()` elements are set.
    `default int` | `setFrom(java.lang.Iterable<? extends T> iterable, int startIndex, int numElements)` Set the elements of this mutable indexable one after the other from the given iterable until either the iterable is emptied or `numElements` elements are set.
    `default void` | `setFromArray(T[] array, int arrayIndex, int startIndex, int numElements)` Set consecutive entries from an array.
    `default void` | `setMulti(int from, int len, T value)` Set multiple elements to the same value.
    `default void` | `shuffle(java.util.Random random)` Randomize the content of this mutable indexable.
    `default MutableIndexable<T>` | `subSet(int fromIndex, int toIndex)` Get an indexable subset.
    `default void` | `swap(int idx1, int idx2)` Swap the values at two indices.
    `default void` | `swyp(int idx1, int idx2)` Swap the values at two indices using Pythonesque indices.
    `default MutableIndexable<T>` | `sybSet(int fromIndex, int toIndex)` Get an indexable subset.
    `default void` | `syt(int index, T elem)` Pythonesque set.
    `default MutableIndexable<T>` | `tailSet(int fromIndex)` Create an indexable subset from the last elements of this indexable set.
    `static <E> MutableIndexable<E>` | `viewArray(E... array)` Mutable indexable view which operates on the given array.
    `static <E> MutableIndexable<E>` | `viewArray(E[] array, int start, int len)` View a slice of an array.
    `static <IT,OT> MutableIndexable.Base<OT>` | `viewIndexable(Indexable<IT> indexable, java.util.function.Function<? super IT,OT> getter, java.util.function.BiConsumer<? super IT,? super OT> setter)` View a generic indexable as a mutable indexable by accessing a property of the elements of the underlying generic indexable.
    `static <E> MutableIndexable<E>` | `viewList(java.util.List<E> list)` Mutable indexable view which operates on the given array.

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

      `addToArray, addToArray, addToCollection, asBase, 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, get, getMod, gyt, hash, indexedView, indexes, init, initByIndex, intIndexes, isEmpty, isOrdered, isStrictlyOrdered, iterator, iterator, last, mapArray, optional, ordered, rotated, singleton, 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.Sizeable

      `size`

- - ### Field Detail

    - #### EMPTY

          static final MutableIndexable<java.lang.Object> EMPTY

      Empty mutable indexable. Use `empty()` instead.

  - ### Method Detail

    - #### set

          void set(int index,
                   T elem)

      Set the element at the given index.
      Parameters:
        `index` - index between `0` and `size() - 1`
        `elem` - element to put to the given index

    - #### syt

          default void syt(int index,
                           T elem)

      Pythonesque set. This allows to access elements from the back by using negative indexes, e.g. `-1` references the last element, `-2` its predecessor, and so on.
      Parameters:
        `index` - index between `-size()` and `size() - 1`
        `elem` - element to put to the given index

    - #### setFrom

          default int setFrom(@NotNull
                              java.lang.Iterable<? extends T> iterable)

      Set the elements of this mutable indexable one after the other from the given iterable until either the iterable is emptied or `Sizeable.size()` elements are set.
      Parameters:
        `iterable` - iterable from which this indexable is filled
      Returns:
        number of elements set

    - #### setFrom

          default int setFrom(@NotNull
                              java.lang.Iterable<? extends T> iterable,
                              int startIndex,
                              int numElements)

      Set the elements of this mutable indexable one after the other from the given iterable until either the iterable is emptied or `numElements` elements are set.
      Parameters:
        `iterable` - iterable from which this indexable is filled
        `startIndex` - start index where the setting begins
        `numElements` - number of elements to set
      Returns:
        number of elements set

    - #### setFromArray

          default void setFromArray(@NotNull
                                    T[] array,
                                    int arrayIndex,
                                    int startIndex,
                                    int numElements)

      Set consecutive entries from an array. This will set less elements
      Parameters:
        `array` - array with elements to set from
        `arrayIndex` - start index in the array
        `startIndex` - start index in this mutable indexable
        `numElements` - number of elements to copy
      Throws:
        `java.lang.IndexOutOfBoundsException` - if this mutable indexable would overflow by this operation
        `java.lang.ArrayIndexOutOfBoundsException` - if array overflows by this operation

    - #### setMulti

          default void setMulti(int from,
                                int len,
                                T value)

      Set multiple elements to the same value.
      Parameters:
        `from` - first index to be set (Pythonesque)
        `len` - number of elements to be set (non-negative)
        `value` - value to be set

    - #### copyInternally

          default void copyInternally(int fromIndex,
                                      int toIndex,
                                      int numElements)

      Copy elements inside this indexable.
      Parameters:
        `fromIndex` - start index from where elements are copied (Pythonesque)
        `toIndex` - start index to where elements are copied (Pythonesque)
        `numElements` - number of elements to copy

    - #### fillFrom

          default void fillFrom(@NotNull
                                java.util.function.IntFunction<? extends T> provider)

      Fill this indexable from a provider.
      Parameters:
        `provider` - provider which is called for each index and provides the element for that index

    - #### swap

          default void swap(int idx1,
                            int idx2)

      Swap the values at two indices.
      Parameters:
        `idx1` - first index
        `idx2` - second index

    - #### swyp

          default void swyp(int idx1,
                            int idx2)

      Swap the values at two indices using Pythonesque indices.
      Parameters:
        `idx1` - first index (`Pythonesque`)
        `idx2` - second index (`Pythonesque`)

    - #### subSet

          @NotNull
          default MutableIndexable<T> subSet(int fromIndex,
                                                      int toIndex)

      Description copied from interface: `Indexable`
      Get an indexable subset. The subset includes indices `fromIndex` to `toIndex - 1`.
      Specified by:
        `subSet` in interface `Indexable<T>`
      Parameters:
        `fromIndex` - start index of sub set
        `toIndex` - index after last index
      Returns:
        indexable subset view of this indexable

    - #### sybSet

          @NotNull
          default MutableIndexable<T> sybSet(int fromIndex,
                                                      int toIndex)

      Description copied from interface: `Indexable`
      Get an indexable subset. This is the Pythonesque version which allows negative indexes.
      Specified by:
        `sybSet` in interface `Indexable<T>`
      Parameters:
        `fromIndex` - start index of sub set
        `toIndex` - end index of sub set
      Returns:
        indexable subset view of this indexable set

    - #### tailSet

          @NotNull
          default MutableIndexable<T> tailSet(int fromIndex)

      Description copied from interface: `Indexable`
      Create an indexable subset from the last elements of this indexable set. This already allows Pythonesquew indexing.
      Specified by:
        `tailSet` in interface `Indexable<T>`
      Parameters:
        `fromIndex` - index to start with, negative counts from the back
      Returns:
        indexable subset view of this indexable set

    - #### headSet

          @NotNull
          default MutableIndexable<T> headSet(int toIndex)

      Description copied from interface: `Indexable`
      Create an indexable subset from the last elements of this indexable set. This already allows Pythonesquew indexing.
      Specified by:
        `headSet` in interface `Indexable<T>`
      Parameters:
        `toIndex` - index one after the end (equal to the length of the returned set), negative counts from the back
      Returns:
        indexable subset view of this indexable set

    - #### listIterator

          @NotNull
          default java.util.ListIterator<T> listIterator()

      Overridden to allow setting via the returned iterator.
      Specified by:
        `listIterator` in interface `Indexable<T>`
      Returns:
        list iterator which allows `setting`, but not `adding` or `deleting`

    - #### reverse

          @NotNull
          default MutableIndexable<T> reverse()

      Description copied from interface: `Indexable`
      Get this indexable but with inverted order.
      Specified by:
        `reverse` in interface `Indexable<T>`
      Returns:
        a view of this indexable which accesses the elements in reverse order

    - #### revert

          default void revert(int from,
                              int to)

      Revert the order of all elements in the given range. Attention: the `to` element is also included in the reversion to allow easy reversion at the end by using `-1`.
      Parameters:
        `from` - start element of reversion (Pythonesque), included
        `to` - end element of reversion (Pythonesque), included

    - #### revert

          default void revert()

      Revert the elements in this indexable. This reverts the order of all elements.

    - #### order

          default void order(@NotNull
                             Ordering<? super T> ordering)

      Order the elements in this indexable by the given ordering. After this call the elements of this indexable are reordered so that `Indexable.isOrdered(Ordering)` returns `true` for the given `ordering`.

      Introduced by the overhead due to accessing elements via this interface ordering via this method is some 1% slower than sorting an array with standard `Arrays.sort(Object[], Comparator)`. Sort the array first, if this is a problem for you.

      Parameters:
        `ordering` - ordering to apply

    - #### shuffle

          default void shuffle(@NotNull
                               java.util.Random random)

      Randomize the content of this mutable indexable. This will reorder the elements randomly.
      Parameters:
        `random` - random number generator

    - #### asList

          @NotNull
          default java.util.List<T> asList()

      View this indexable as a standard list. Overwritten to allow for modifications. The returned list will allow usage of the `List.set(int, Object)` method, but neither any adding nor deleting methods. Standard sorting algorithms will work on the returned list as a sorting algorithm is expected to neither add nor delete elements.
      Specified by:
        `asList` in interface `Indexable<T>`
      Returns:
        list allowing setting elements
      See Also:
        `Countable.toList()`

    - #### applyOnEach

          default void applyOnEach(@NotNull
                                   java.util.function.Function<? super T,? extends T> operator)

      Apply the given operator on each element.
      Parameters:
        `operator` - operator to apply

    - #### getCopy

          @NotNull
          default MutableIndexable<T> getCopy()

      Get a flat copy of this mutable indexable. This will not copy elements, if this is required use `getCopy(Function)` which allows to define how elements are copied.
      Returns:
        a copy of this mutable indexable

    - #### getCopy

          @NotNull
          default MutableIndexable<T> getCopy(@Nullable
                                                       java.util.function.Function<? super T,? extends T> elementCloner)

      Get a copy of this object, allowing to define a copy method for the elements.
      Parameters:
        `elementCloner` - function for cloning each element before adding it to the copy, if `null` elements are copied directly, which will couple this mutable indexable and the returned copy if the elemtns are mutable: when an element is changed this is reflected in both.
      Returns:
        copy of this mutable indexable

    - #### init

          @NotNull
          static <E> MutableIndexable<E> init(int size,
                                                       @NotNull
                                                       java.util.function.Supplier<E> creator)

      Initialize a mutable indexable to a given size.
      Type Parameters:
        `E` - element type
      Parameters:
        `size` - size of indexable
        `creator` - creator for the initial elements, called in order for each element
      Returns:
        mutable indexable with the given size

    - #### initFragile

          @NotNull
          static <E,X extends java.lang.Exception> MutableIndexable<E> initFragile(int size,
                                                                                            @NotNull
                                                                                            FragileFunction0<E,X> creator)
                                                                                     throws X extends java.lang.Exception

      Initialize a mutable indexable to a given size while allowing exceptions.
      Specified by:
        `initFragile` in interface `Indexable<T>`
      Type Parameters:
        `E` - element type
        `X` - exception type
      Parameters:
        `size` - size of indexable
        `creator` - creator for the initial elements, called in order for each element, may throw an exception
      Returns:
        mutable indexable with the given size
      Throws:
        `X` - if `creator` throws
        `X extends java.lang.Exception`

    - #### initByIndex

          @NotNull
          static <E> MutableIndexable<E> initByIndex(int size,
                                                              @NotNull
                                                              java.util.function.IntFunction<? extends E> producer)

      Create a mutable indexable of a given size, and initialize its elements by index.
      Type Parameters:
        `E` - element type
      Parameters:
        `size` - size of returned indexable
        `producer` - element producer which will be called for each index
      Returns:
        mutable indexable with the given size filled from the provider

    - #### filled

          @NotNull
           @Deprecated
          static <E> MutableIndexable<E> filled(int size,
                                                                      @NotNull
                                                                      java.util.function.IntFunction<? extends E> provider)

      Deprecated. inconsistently named, use `initByIndex(int, IntFunction)` instead
      Initialize a mutable indexable from a provider.
      Type Parameters:
        `E` - element type
      Parameters:
        `size` - size of returned indexable
        `provider` - provider called for each index to set the element at that index
      Returns:
        mutable indexable with the given size filled from the provider

    - #### nulled

          @NotNull
          static <E> MutableIndexable<E> nulled(int size)

      Get a mutable indexable of a given size filled with `null` values.
      Type Parameters:
        `E` - element type of the returned indexable
      Parameters:
        `size` - size of the returned indexable
      Returns:
        mutable indexable of the given size, where all elements are `null`

    - #### copyOf

          @NotNull
          static <E> MutableIndexable<E> copyOf(@NotNull
                                                         java.util.Collection<E> collection)

      Create a mutable indexable which is intialized from a given collection.
      Type Parameters:
        `E` - list and result element type
      Parameters:
        `collection` - collection
      Returns:
        mutable indexable

    - #### copy

          @NotNull
          static <E,IN> MutableIndexable<E> copy(@NotNull
                                                          java.util.Collection<IN> collection,
                                                          @NotNull
                                                          java.util.function.Function<IN,E> copier)

      Create a mutable indexable which is initialized from copied elements of a given collection.
      Type Parameters:
        `E` - result element type
        `IN` - incoming element type
      Parameters:
        `collection` - collection
        `copier` - element copier
      Returns:
        mutable indexable

    - #### empty

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

      Get an empty mutable indexable.
      Specified by:
        `empty` in interface `Countable<T>`
      Type Parameters:
        `E` - element type
      Returns:
        mutable indexable with no elements, always the same object

    - #### fromArray

          @SafeVarargs
           @NotNull
          static <E> MutableIndexable<E> fromArray(@NotNull
                                                                          E... elements)

      Create a mutable indexable which is initialized from elements of the given array.
      Specified by:
        `fromArray` in interface `Indexable<T>`
      Type Parameters:
        `E` - element type
      Parameters:
        `elements` - elements
      Returns:
        mutable indexable independent of `elements`

    - #### fromArray

          @NotNull
          static <E> MutableIndexable<E> fromArray(@NotNull
                                                            E[] elements,
                                                            int startIndex,
                                                            int length)

      Create a mutable indexable which is initialized from elements of the given array.
      Type Parameters:
        `E` - element type
      Parameters:
        `elements` - array of elements
        `startIndex` - index of first element used in the returned indxable
        `length` - length number of elements used in the returned indexable
      Returns:
        mutable indexable independnet of `eleements`

    - #### viewArray

          @NotNull
           @SafeVarargs
          static <E> MutableIndexable<E> viewArray(@NotNull
                                                                          E... array)

      Mutable indexable view which operates on the given array. Any changes done by the returned indexable will be forwarded to the array.
      Specified by:
        `viewArray` in interface `Countable<T>`
      Specified by:
        `viewArray` in interface `Indexable<T>`
      Type Parameters:
        `E` - element type
      Parameters:
        `array` - array
      Returns:
        mutable indexable view of the given array

    - #### viewArray

          @NotNull
          static <E> MutableIndexable<E> viewArray(@NotNull
                                                            E[] array,
                                                            int start,
                                                            int len)

      View a slice of an array.
      Specified by:
        `viewArray` in interface `Countable<T>`
      Specified by:
        `viewArray` in interface `Indexable<T>`
      Type Parameters:
        `E` - array type
      Parameters:
        `array` - array to view
        `start` - start of array slice represented by the returned indexable
        `len` - length of array slice represented by the returned indexable
      Returns:
        indexable view of the given array slice, basically the same as `MutableIndexable.viewArray(array).subset(start, start + len)`

    - #### viewList

          @NotNull
          static <E> MutableIndexable<E> viewList(@NotNull
                                                           java.util.List<E> list)

      Mutable indexable view which operates on the given array. Any changes done by the returned indexable will be forwarded to the list.
      Type Parameters:
        `E` - element type
      Parameters:
        `list` - list
      Returns:
        mutable indexable view of the given list

    - #### fromIndexable

          @NotNull
          static <E> MutableIndexable<E> fromIndexable(@NotNull
                                                                Indexable<E> indexable)

      Create a mutable indexable which is the copy of a standard indexable.
      Type Parameters:
        `E` - element type
      Parameters:
        `indexable` - standard indexable
      Returns:
        mutable indexable initialize from the standard indexable

    - #### fromIndexable

          @NotNull
          static <E,B> MutableIndexable<E> fromIndexable(@NotNull
                                                                  Indexable<B> indexable,
                                                                  @NotNull
                                                                  java.util.function.Function<B,E> converter)

      Create a mutable indexable which is the copy of a standard indexable. This especieally allows to copy each element during the initialization.
      Type Parameters:
        `E` - element type of returned mutable indexable
        `B` - element type of incoming idexable
      Parameters:
        `indexable` - base indexable
        `converter` - converter from base indexable type to result element type,
      Returns:
        mutable indexable

    - #### viewIndexable

          @NotNull
          static <IT,OT> MutableIndexable.Base<OT> viewIndexable(@NotNull
                                                                          Indexable<IT> indexable,
                                                                          @NotNull
                                                                          java.util.function.Function<? super IT,OT> getter,
                                                                          @NotNull
                                                                          java.util.function.BiConsumer<? super IT,? super OT> setter)

      View a generic indexable as a mutable indexable by accessing a property of the elements of the underlying generic indexable.

      This is useful if you have complex items, but are interested into only one property of each item.

      Type Parameters:
        `IT` - element type of the underlying indexable
        `OT` - element type of the returned indexable
      Parameters:
        `indexable` - underlying generic indexable
        `getter` - function used to extract the property of interest
        `setter` - procedure used to set the property of interest
      Returns:
        mutable indexable view of the underlying indexable

    - #### fromIterable

          @NotNull
          static <E> MutableIndexable<E> fromIterable(int size,
                                                               @NotNull
                                                               java.lang.Iterable<E> iter)

      Create a mutable indexable from an iterable or a part of it.
      Type Parameters:
        `E` - element type
      Parameters:
        `size` - maximum size of returned indexable
        `iter` - iterable used for initializing the indexable
      Returns:
        mutable indexable