commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Jablow" <>
Subject RE: [collections] Decorator suggestion
Date Fri, 16 Jun 2006 02:00:30 GMT

Stephen Colebourne [] 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:

Eric Jablow

View raw message