Interface ContainerShortBatchIterator

All Known Implementing Classes:
ArrayShortBatchIterator, BitmapShortBatchIterator, RunShortBatchIterator, TwoValuesContainer.ContainerShortBatchIter

public interface ContainerShortBatchIterator
  • Method Summary

    Modifier and Type Method Description
    boolean forEach​(ShortConsumer sc)
    Starting from the next iterator position (if any), feed values to the consumer until it returns false.
    boolean hasNext()
    Whether the underlying container is exhausted or not
    int next​(short[] buffer, int offset, int maxCount)
    Writes to buffer the next batch of values, and returns how much of the buffer was used.
  • Method Details

    • next

      int next​(short[] buffer, int offset, int maxCount)
      Writes to buffer the next batch of values, and returns how much of the buffer was used.
      Parameters:
      buffer - the buffer to write values onto.
      offset - first position to start writing in buffer.
      maxCount - max number of elements to write to buffer.
      Returns:
      how many values were written.
    • hasNext

      boolean hasNext()
      Whether the underlying container is exhausted or not
      Returns:
      true if there is data remaining
    • forEach

      boolean forEach​(ShortConsumer sc)
      Starting from the next iterator position (if any), feed values to the consumer until it returns false. After each value is consumed, the current iterator position is moving forward; eg, a call to forEach that consumes 4 elements effectively works as if next was called 4 times.
      Parameters:
      sc - a ShortConsumer to feed values to.
      Returns:
      false if the processing was stopped by the consumer returning false, true otherwise.