Class SliceImpl<T>

  • All Implemented Interfaces:
    Slice<T>

    public class SliceImpl<T>
    extends AbstractSlice<T>
    A concrete implementation of a Slice.
    • Constructor Detail

      • SliceImpl

        public SliceImpl​(int number,
                         int size,
                         SortingData sortingData,
                         java.util.List<T> content,
                         boolean hasNext)
        Constructor.
        Parameters:
        number - Number of slice.
        size - Slice size.
        sortingData - The SortingData that was used to sort contents of this slice.
        content - Content in this slice.
        hasNext - A flag indicating whether there is another slice.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Description copied from interface: Slice
        Indicates whether this is the last slice.
        Returns:
        true if it is the last slice, or false otherwise.
      • map

        public <U> Slice<U> map​(java.util.function.Function<T,​U> mapper)
        Description copied from interface: Slice
        Maps the content of this slice according to the given mapper.
        Type Parameters:
        U - Concrete type of the resulting contents.
        Parameters:
        mapper - A Function that maps the contents of this slice.
        Returns:
        A new slice containing the mapped elements.