[concurrency-interest] forkjoin.ParallelArray and friends

Gregg Wonderly gregg at cytetech.com
Tue Aug 28 10:04:02 EDT 2007


Doug Lea wrote:
> (*) "almost-uniform" because a few differences between
> scalars and objects show up in APIs. For example max()
> for objects returns null for empty arrays
> (or empty selections) for objects, but Double.MIN_VALUE
> for doubles. (It would be possible to throw an exception
> instead in both cases to make them uniform, but this
> would not interact well with the base-case processing
> conventions people normally use.)

So a casual suggestion of the top of my head would be to provide an
isEmpty() method, a setEmptyReturnValue() method, and make the max method throw 
a EmptyArrayException if setEmptyReturnValue() has not been called.

Gregg Wonderly


More information about the Concurrency-interest mailing list