Class Spliterators
java.lang.Object
java.util.Spliterators
Ways to make a
Spliterator of a collection or an iterator, and an
iterator of a spliterator.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Spliterator<T> A spliterator of no elements.static <T> Iterator<T> iterator(Spliterator<? extends T> spliterator) The elements ofspliterator, as an iterator.static <T> Spliterator<T> spliterator(Collection<? extends T> c, int characteristics) The elements ofc.static <T> Spliterator<T> spliterator(Iterator<? extends T> iterator, long size, int characteristics) Thesizeelements ofiterator.static <T> Spliterator<T> spliteratorUnknownSize(Iterator<? extends T> iterator, int characteristics) The elements ofiterator, however many there are.
-
Method Details
-
emptySpliterator
A spliterator of no elements. -
spliterator
The elements ofc. 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) Thesizeelements ofiterator. -
spliteratorUnknownSize
public static <T> Spliterator<T> spliteratorUnknownSize(Iterator<? extends T> iterator, int characteristics) The elements ofiterator, however many there are. -
iterator
The elements ofspliterator, as an iterator.
-