----- Mail original -----
De: "Brian Goetz" <brian.goetz@oracle.com> À: "Remi Forax" <forax@univ-mlv.fr>, "Stephen Colebourne" <scolebourne@joda.org> Cc: "core-libs-dev" <core-libs-dev@openjdk.java.net> Envoyé: Samedi 24 Avril 2021 00:40:54 Objet: Re: New Collections interface - Sized
This is basically Spliterator, an iterator + a size, with the iterator is "push" instead of "pull" because it's more efficient.
In details a Spliterator is either - an Iterable (with no SIZED characteristic) - an Iterable + size (if SIZED and estimateSize() != Long.MAX_VALUE) - an Iterable + comparator (if SORTED and comparator != null) - an Iterable + split (if trySplit != null)
and all combinations of the above.
oops, i've written Iterable instead of Iterator.
So, you're asking for Spliterable<T>, no? :)
a Supplier<Spliterator<T>> is a Spliterable<T>, as in StreamSupport.stream() [1]. Rémi [1] https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/strea...)