Tabulators -- a catalog (original) (raw)

Brian Goetz brian.goetz at oracle.com
Fri Dec 28 07:28:17 PST 2012


So the thing to do here is return Object[] instead of T[] / D[]. Sad, but not terrible. Not important enough to have the user pass in a factory. For want of a Pair...

On 12/28/2012 9:39 AM, Remi Forax wrote:

On 12/28/2012 03:23 AM, Brian Goetz wrote:

Here's a catalog of the currently implemented Tabulators. [...]

3. Partition. Partitions a stream according to a predicate. Results always are a two-element array of something. Five forms:

// Basic Tabulator<T, Collection[]> partition(Predicate predicate) // Explicit factory <T, C extends Collection> Tabulator<T, C[]> partition(Predicate predicate, Supplier rowFactory) // Partitioned mutable reduce <T, D> Tabulator<T, D[]> partition(Predicate predicate, MutableReducer<T,D> downstream) // Partitioned functional reduce Tabulator<T, T[]> partition(Predicate predicate, T zero, BinaryOperator reducer) // Partitioned functional map-reduce Tabulator<T, T[]> partition(Predicate predicate, T zero, Function<T, U> mapper, BinaryOperator reducer) You can't create an array of T (C, D) safely, so casting an array of Object to an array of T is maybe acceptable if you control all the access to that array like in collections, but here you export it. Rémi



More information about the lambda-libs-spec-experts mailing list