Substitute for groupingReduce ?
Michael Nascimento
misterm at gmail.com
Wed Mar 20 13:05:53 PDT 2013
There is no reducing in b81. What are you talking about? Maybe this:
groupingBy(f).thenReducing(stuff)
?
Regards,
Michael
On Wed, Mar 20, 2013 at 5:01 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> More generally: all the forms of
> groupingReduce(f, stuff)
> are now written as some form of
> groupingBy(f, reducing(stuff))
>
>
>
> On 3/20/2013 3:49 PM, Michael Nascimento wrote:
>>
>> On Wed, Mar 20, 2013 at 4:36 PM, Brian Goetz <brian.goetz at oracle.com>
>> wrote:
>>>
>>> I think you're missing a reduce function in that call? I see a
>>> classifying
>>> function and a merge function.
>>
>>
>> This compiled with b76. I am migrating a code base that was running
>> with a previous JDK.
>>
>> So there is no substitute that assumes the returned value is a unique
>> index and throws an Exception if it is not? This is what
>> Maps.uniqueIndex does:
>>
>>
>> http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/Maps.html#uniqueIndex(java.lang.Iterable,
>> com.google.common.base.Function)
>>
>> and what the groupingReduce variant did with the throwingMerger. I
>> still didn't quite understand how to rewrite this...
>>
>> Regards,
>> Michael
>>
>
More information about the lambda-dev
mailing list