RFR 8071477: Better Spliterator implementations for String.chars() and String.codePoints()

Xueming Shen xueming.shen at oracle.com
Fri Jan 23 21:51:26 UTC 2015


On 01/23/2015 12:51 PM, Paul Sandoz wrote:
>
> No, because a supplier of a spliterator is used (as is the case for the CharSequence implementations):
>
> return StreamSupport.intStream(
>          () ->  new String.IntCharArraySpliterator(value, 0, count, 0),
>          Spliterator.ORDERED | Spliterator.SIZED | Spliterator.SUBSIZED,
>          false);
>
> the "value" and the "count" will be obtained when the terminal operation executed not when the Stream is created and returned.

thanks! I missed it's a supplier of spliterator is being passed in:-)

-Sherman



More information about the core-libs-dev mailing list