Interface MutableIntSlice

All Superinterfaces:
Enumeration<Integer>, IntSlice, IntView, Iterable<Integer>, MutableSlice<Integer>, Resettable, ResettableEnumeration<Integer>, Slice<Integer>, View<Integer>
All Known Implementing Classes:
MutableArrayIntSlice

@API(status=STABLE) public interface MutableIntSlice extends MutableSlice<Integer>, IntSlice
A mutable slice is a subtype of a regular IntSlice, which allows mutating the start- and end-index of the slice. This allows the reduction of allocation overhead in loops for example.
Since:
25/08/2022
  • Method Details

    • of

      @NotNull static @NotNull MutableIntSlice of(int[] ref, int offset, int size)
      Creates a new mutable slice instance which references the given array.
      Parameters:
      ref - The array of which to create a slice.
      offset - The index at which the newly created slice should begin.
      size - The size of the newly created slice.
      Returns:
      A new mutable slice instance, which references the given array.
    • of

      @NotNull static @NotNull MutableIntSlice of(int... ref)
      Creates a new mutable slice instance which references the given array.
      Parameters:
      ref - The array of which to create a slice.
      Returns:
      A new mutable slice instance, which references the given array.