JEP 473: Stream Gatherers (Second Preview)

Viktor Klang viktor.klang at oracle.com
Sun Apr 7 16:11:11 UTC 2024


Hi Ernie,

"Many" in this case refers to "N", which is "0 ... N", so I'd say while it is techincally correct as-is, perhaps more precise would be to say "1-to-0..1" gatherer, since for every element in, there is 0 or 1 element out.

Many-to-one would be 0..N -> 1, which means that an empty input would yield a single output.

Cheers,
√


Viktor Klang
Software Architect, Java Platform Group
Oracle
________________________________
From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Ernie Rael <errael at raelity.com>
Sent: Sunday, 7 April 2024 18:06
To: core-libs-dev at openjdk.org <core-libs-dev at openjdk.org>
Subject: JEP 473: Stream Gatherers (Second Preview)


This is about what might be a minor doc issue.

In https://openjdk.org/jeps/473 it says

As another example, Stream::filter takes a predicate that determines whether an input element should be passed downstream; this is simply a stateless one-to-many gatherer.
Shouldn't this be "many-to-one"?

-ernie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240407/d557e14d/attachment-0001.htm>


More information about the core-libs-dev mailing list