Initial prototype for BiStream
mike.duigou at oracle.com
Wed Apr 18 15:39:28 PDT 2012
I've committed an initial prototype for Bi-Value streams aka MapStream. In addition to the new Stream type (we know the naming is inconsistent with Iterable) there are several new functional interfaces introduced for use with MapStream methods. These functional interfaces are two parameter versions of Block, Mapper and Predicate.
There's a big question lurking in the implementation involving boxing/unboxing of BiValue<L,R> as used by the BiBlock, BiMapper and Predicate. In some cases using the single param functional interfaces, ie. Predicate<BiValue<L,R>> is more convenient or efficient than using BiPredicate<L,R>. The source data isn't always a Map though and elements might not already be stored in BiValues though. In these cases adding boxing would be a real cost.
More work is required on this interface but now seemed like a good place to introduce it.
More information about the lambda-dev