Stephen Colebourne [mailto:[EMAIL PROTECTED] wrote: > I wrote: >> Brian Goetz, in an article last year for IBM DeveloperWorks, >> suggested writing a set wrapper that would allow initialization >> code like: >> >> private final static Set COMMANDS = >> new UnmodifiableSetBuilder(new HashSet()) >> .append("Save") >> .append("Revert") >> .append("Close") >> .unmodifiableSet(); >> ... > instead of the wordier but normal > >This is an interesting idea. I would have thought that a single >SetBuilder that could produce a modifiable as well as an unmodifiable >set would make more sense. > ... Perhaps the collections project could use some of the backlogged code already contributed for it. Fred Loney, as part of JIRA issue COLLECTIONS-183, contributed an AppendableList class. Copy and paste methods to get AppendableXXX decorators, subclass them to get builder classes like the one above, and we'll have a good start. As I said, I'm willing to help. The Goetz article is available at: http://www-128.ibm.com/developerworks/java/library/j-jtp04275.html Respectfully, Eric Jablow
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]