Package io.karma.sliced.slice.mutable
Interface MutableIntSlice
- All Superinterfaces:
Enumeration<Integer>
,IntSlice
,IntView
,Iterable<Integer>
,MutableSlice<Integer>
,Resettable
,ResettableEnumeration<Integer>
,Slice<Integer>
,View<Integer>
- All Known Implementing Classes:
MutableArrayIntSlice
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 Summary
Modifier and TypeMethodDescriptionstatic @NotNull MutableIntSlice
of
(int... ref) Creates a new mutable slice instance which references the given array.static @NotNull MutableIntSlice
of
(int[] ref, int offset, int size) Creates a new mutable slice instance which references the given array.Methods inherited from interface java.util.Enumeration
asIterator, hasMoreElements, nextElement
Methods inherited from interface io.karma.sliced.slice.IntSlice
asSlice, get, getInt, map, toIntArray, toIntArray
Methods inherited from interface io.karma.sliced.view.IntView
intIterator, intSpliterator, intStream, iterator, parallelIntStream
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface io.karma.sliced.slice.mutable.MutableSlice
setOffset, setSize
Methods inherited from interface io.karma.sliced.util.Resettable
reset
Methods inherited from interface io.karma.sliced.slice.Slice
copy, copy, copy, copyArrayList, copyHashSet, forEachIndexed, getOptional, getOrElse, getOrThrow, map, offset, slice, toArray, toArray
Methods inherited from interface io.karma.sliced.view.View
contains, containsAll, containsAllRefs, containsRef, contentEquals, contentEquals, copyArrayList, copyHashSet, forAll, forAllIndexed, parallelStream, referencesEqual, referencesEqual, size, stream
-
Method Details
-
of
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
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.
-