Devoxx - filter, partition and offset (original) (raw)
Brian Goetz brian.goetz at oracle.com
Wed Apr 3 05:22:44 PDT 2013
- Previous message: Devoxx - filter, partition and offset
- Next message: Devoxx - filter, partition and offset
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
The partitioningBy method also looked very confusing. My take on parttition as a concept was to split a list into two lists. Reading the documentation and the method signature didn't tell me what the method does at all. I certainly didn't grok the boolean.
In a functional language where tuples and lists are built in, the natural return type for partition is a tuple of lists. But we don't get it that easy.
We experimented with a number of forms here; a two-element array (arrays and generics don't play nicely), a special Partition object, etc. In the end a Map<Boolean, List> seemed most natural, and also behaved mostly like the other composible Collector combinator, groupingBy.
With an API contaiing limit(), my database work expected me to see a matching offset(). I understand that there are issues with parallel, but it looked like an omission.
substream(n) and substream(n, m).
- Previous message: Devoxx - filter, partition and offset
- Next message: Devoxx - filter, partition and offset
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]