Class Spliterators

java.lang.Object
java.util.Spliterators

public final class Spliterators extends Object
Ways to make a Spliterator of a collection or an iterator, and an iterator of a spliterator.
  • Method Details

    • emptySpliterator

      public static <T> Spliterator<T> emptySpliterator()
      A spliterator of no elements.
    • spliterator

      public static <T> Spliterator<T> spliterator(Collection<? extends T> c, int characteristics)
      The elements of c. Its iterator is asked for when the first element is, not now, so elements added in between are seen, as the JDK's collections do.
    • spliterator

      public static <T> Spliterator<T> spliterator(Iterator<? extends T> iterator, long size, int characteristics)
      The size elements of iterator.
    • spliteratorUnknownSize

      public static <T> Spliterator<T> spliteratorUnknownSize(Iterator<? extends T> iterator, int characteristics)
      The elements of iterator, however many there are.
    • iterator

      public static <T> Iterator<T> iterator(Spliterator<? extends T> spliterator)
      The elements of spliterator, as an iterator.