Class EmptyBoolSlice

java.lang.Object
io.karma.sliced.slice.impl.EmptyBoolSlice
All Implemented Interfaces:
BoolSlice, Slice<Boolean>, Resettable, ResettableEnumeration<Boolean>, BoolView, View<Boolean>, Iterable<Boolean>, Enumeration<Boolean>

@API(status=INTERNAL) public final class EmptyBoolSlice extends Object implements BoolSlice
Since:
25/02/2024
  • Field Details

  • Method Details

    • getBool

      public boolean getBool(int index)
      Description copied from interface: BoolSlice
      Retrieves a boolean value from this slice instance at the given index.
      Specified by:
      getBool in interface BoolSlice
      Parameters:
      index - The index at which to retrieve the element.
      Returns:
      The boolean value at the given index.
    • toBoolArray

      public boolean[] toBoolArray(int offset, int size)
      Description copied from interface: BoolSlice
      Creates a new boolean array with the appropriate size, and copies all values from start to end into new newly created array using System.arraycopy(Object, int, Object, int, int).
      Specified by:
      toBoolArray in interface BoolSlice
      Parameters:
      offset - The index at which the newly created array should begin (relative to the offset of this slice).
      size - The size of the newly created array.
      Returns:
      A new array containing all elements from start to end.
    • offset

      public int offset()
      Description copied from interface: Slice
      Retrieves the start index of this slice instance.
      Specified by:
      offset in interface Slice<Boolean>
      Returns:
      The start index of this slice instance.
    • slice

      @NotNull public @NotNull Slice<Boolean> 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.
      Specified by:
      slice in interface Slice<Boolean>
      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.
    • reset

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

      @NotNull public @NotNull BoolIterator boolIterator()
      Description copied from interface: BoolView
      Creates a new BoolIterator from the elements referenced by this slice instance.
      Specified by:
      boolIterator in interface BoolView
      Returns:
      A new BoolIterator from the 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<Boolean>
      Returns:
      The number of element contained within the collection/array referenced by this view instance.
    • hasMoreElements

      public boolean hasMoreElements()
      Specified by:
      hasMoreElements in interface Enumeration<Boolean>
    • nextElement

      public Boolean nextElement()
      Specified by:
      nextElement in interface Enumeration<Boolean>