It is "distributing" in the same sense as the distributive law:

    c*(a+b) = c*a + c*b

(Think of the two collectors as the "sum" of a collector, and "distributing" says that you can send the elements to the sum by sending all of the elements to each.)

That said, I agree that the less mathematically-inclined might be drawn to the plain-english meaning, which is more like an (imprecise) bisection.

On 6/19/2018 10:14 AM, Zheka Kozlov wrote:
I don't like `distributing` for the same reason as `bisecting`: for me, it sounds like a Stream is giving each collector only a part of elements.

2018-06-19 19:44 GMT+07:00 Brian Goetz <brian.go...@oracle.com <mailto:brian.go...@oracle.com>>:



        collectingToBoth


    This one is actually both evocative of what the method does, and
    in the spirit of the existing naming conventions (collectingAndThen.)

    An n-ary version could just be called `collectingTo`, where it is
    passed a varargs of Collector.  Could we get away with
    collectingTo for a binary version as well?  The existence of the
    "combiner" function might make that a stretch, but I prefer
    `collectingTo` to `collectingToBoth`.


    (I still like `distributing` too.)



Reply via email to