Class MutableListSlice<T,L extends List<T>>

java.lang.Object
io.karma.sliced.slice.mutable.impl.AbstractMutableSlice<T>
io.karma.sliced.slice.mutable.impl.MutableListSlice<T,L>
All Implemented Interfaces:
MutableSlice<T>, Slice<T>, Resettable, ResettableEnumeration<T>, View<T>, Iterable<T>, Enumeration<T>

@API(status=INTERNAL) public final class MutableListSlice<T,L extends List<T>> extends AbstractMutableSlice<T>
Since:
11/08/2022
  • Constructor Details

    • MutableListSlice

      public MutableListSlice(@NotNull L ref, int start, int end)
  • Method Details

    • get

      public T get(int index)
      Description copied from interface: Slice
      Retrieves an element of type Slice at the given index.
      Parameters:
      index - The index of the element which to retrieve.
      Returns:
      The element at the given index.
    • slice

      @NotNull public @NotNull Slice<T> slice(int offset, int size)
      Description copied from interface: Slice
      Creates a new sub-slice from this slice instance, with the given index range relative to the start index of this slice instance.
      Parameters:
      offset - The index at which the newly created slice should begin (relative to the offset of this slice).
      size - The size of the newly created slice.
      Returns:
      A new slice instance containing the same collection/array reference as this slice instance, but with the given relative index range.
    • iterator

      @NotNull public @NotNull Iterator<T> iterator()
    • hasMoreElements

      public boolean hasMoreElements()
    • nextElement

      public T nextElement()
    • reset

      public void reset()
      Description copied from interface: Resettable
      Resets the internal states of this object instance.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object