Interface ObjectSpliterator<K>

All Superinterfaces:
Spliterator<K>
All Known Implementing Classes:
AbstractObjectSpliterator, ObjectBigSpliterators.AbstractIndexBasedSpliterator, ObjectBigSpliterators.EarlyBindingSizeIndexBasedSpliterator, ObjectBigSpliterators.LateBindingSizeIndexBasedSpliterator, ObjectSpliterators.AbstractIndexBasedSpliterator, ObjectSpliterators.EarlyBindingSizeIndexBasedSpliterator, ObjectSpliterators.EmptySpliterator, ObjectSpliterators.LateBindingSizeIndexBasedSpliterator

public interface ObjectSpliterator<K> extends Spliterator<K>
A type-specific Spliterator; provides an additional methods to avoid (un)boxing, and the possibility to skip elements.
Since:
8.5.0
Author:
C. Sean Young <csyoung@google.com>
See Also:
  • Method Details

    • skip

      default long skip(long n)
      Skips the given number of elements.

      The effect of this call is exactly the same as that of calling Spliterator.tryAdvance(Consumer) for n times (possibly stopping if Spliterator.tryAdvance(Consumer) returns false). The action called will do nothing; elements will be discarded.

      Parameters:
      n - the number of elements to skip.
      Returns:
      the number of elements actually skipped.
      See Also:
      Implementation Specification:
      This default implementation is linear in n. It is expected concrete implementations that are capable of it will override it to run lower time, but be prepared for linear time.
    • trySplit

      ObjectSpliterator<K> trySplit()
      Specified by:
      trySplit in interface Spliterator<K>
      API Notes:
      Note that this specification strengthens the one given in Spliterator.trySplit().