Class ArrayFloatView

java.lang.Object
io.karma.sliced.view.impl.ArrayFloatView
All Implemented Interfaces:
FloatView, View<Float>, Iterable<Float>

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

    • ArrayFloatView

      public ArrayFloatView(float[] ref)
  • Method Details

    • floatIterator

      @NotNull public @NotNull FloatIterator floatIterator()
      Description copied from interface: FloatView
      Creates a new FloatIterator from the elements referenced by this slice instance.
      Specified by:
      floatIterator in interface FloatView
      Returns:
      A new FloatIterator from the elements referenced by this slice instance.
    • toFloatArray

      public float[] toFloatArray()
      Description copied from interface: FloatView
      Creates a new float array with the appropriate size, and copies all values into new newly created array using System.arraycopy(Object, int, Object, int, int).
      Specified by:
      toFloatArray in interface FloatView
      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<Float>
      Returns:
      The number of element contained within the collection/array referenced by this view instance.
    • asSlice

      @NotNull public @NotNull Slice<Float> 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<Float>
      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