Spliterator flags as enum (was Initial java.util.Spliterator putback) (original) (raw)
Doug Lea dl at cs.oswego.edu
Fri Mar 29 14:53:44 UTC 2013
- Previous message: Spliterator flags as enum (was Initial java.util.Spliterator putback)
- Next message: Spliterator flags as enum (was Initial java.util.Spliterator putback)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 03/28/13 15:14, Joshua Bloch wrote:
Sounds like a perfect opportunity to put in immutableEnumSet, which is trivial to implement and generally useful. Alternatively, don't share, and see if the performance it good enough. (I suspect it will be.)
Did you think that I of all people would I participate in a performance-related decision without measuring performance? :-)
Imagine that you had to create a new EnumSet object every time you invoked arrayList.iterator(). You'd surely consider alternatives.
But really, the painfulness quotient is equally important. We'd need to create immutableEnumSet class, and another class that can arbitrarily extend the Spliterator's enums with other control flags, all for the sake of arriving at an API that seems less clear and less easy to use than what we have.
-Doug
- Previous message: Spliterator flags as enum (was Initial java.util.Spliterator putback)
- Next message: Spliterator flags as enum (was Initial java.util.Spliterator putback)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]