Class ArrayIntView

java.lang.Object
io.karma.sliced.view.impl.ArrayIntView
All Implemented Interfaces:
IntView, View<Integer>, Iterable<Integer>

@API(status=INTERNAL) public final class ArrayIntView extends Object implements IntView
Since:
04/09/2022
  • Constructor Details

    • ArrayIntView

      public ArrayIntView(int[] ref)
  • Method Details

    • intIterator

      @NotNull public @NotNull IntIterator intIterator()
      Description copied from interface: IntView
      Creates a new IntIterator from the elements referenced by this slice instance.
      Specified by:
      intIterator in interface IntView
      Returns:
      A new IntIterator from the elements referenced by this slice instance.
    • intSpliterator

      @NotNull public Spliterator.OfInt intSpliterator()
      Description copied from interface: IntView
      Creates a new Spliterator.OfInt from the elements referenced by this slice instance.
      Specified by:
      intSpliterator in interface IntView
      Returns:
      A new Spliterator.OfInt from the elements referenced by this slice instance.
    • toIntArray

      public int[] toIntArray()
      Description copied from interface: IntView
      Creates a new int array with the appropriate size, and copies all values into new newly created array using System.arraycopy(Object, int, Object, int, int).
      Specified by:
      toIntArray in interface IntView
      Returns:
      A new array containing all elements referenced by this slice instance.
    • size

      public int size()
      Description copied from interface: View
      Retrieves the number of elements contained within the array/collection referenced by this array.
      Specified by:
      size in interface View<Integer>
      Returns:
      The number of element contained within the collection/array referenced by this view instance.
    • asSlice

      @NotNull public @NotNull Slice<Integer> asSlice()
      Description copied from interface: View
      Creates a new slice instance from this view instance containing the same underlying collection reference, or a newly created wrapper list if there's no specialization available for the type of the underlying collection. Note If you want to create slices directly, see Slice.of(Object[]) and it's overloads.
      Specified by:
      asSlice in interface View<Integer>
      Returns:
      A new slice instance with a reference to the same collection/array as this view 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