eclipse / eclipse-collections

Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.
http://www.eclipse.org/collections
2.42k stars 604 forks source link

Implement RichIterable.reduceBy(). Fixes #134 #1540

Closed motlin closed 6 months ago

motlin commented 6 months ago

@motlin This looks like a nice addition. I would recommend adding at since 12.0 tags in all of the interfaces. I also think there needs to be special handling for MultiReader classes, similar to the synchronized types.

I'm about to push a new change that updates since from ? to 12.0 and overrides these methods in AbstractMultiReaderMutableCollection. However, I picked the places to place overrides by following the places where we have overridden the methods aggregateBy and countBy. None of these methods are overridden in the MultiReader collections. I don't think they need to be for correctness, because they're all implemented by delegating to forEach() which does the right thing. It might be nice to override them for other reasons.

motlin commented 6 months ago

@donraab I see your 👍 but you still have the request for changes so I want to make sure it's all good before I click Merge.