commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Carlson <joncrl...@yahoo.com>
Subject RE: [Collections] ReadOnly Collection decorators
Date Mon, 10 Jun 2002 19:42:31 GMT
Argghh!  I'd never noticed those way down at the bottom of
the javadoc before.  Thanks.

Iterator and ListIterator aren't in there for some reason. 
However, I suppose it could be argued that you should just
return unmodifiable collections instead of iterators.

Jonathan

--- "Jack, Paul" <pjack@sfaf.org> wrote:
> Um, the JDK already provides what you're looking for:
> 
> java.util.Collections.unmodifiableSet(Set set)
> Collections.unmodifiableList(List list)
> Collections.unmodifiableMap(Map map)
> 
> and so on.  We should probably provide similar things for
> Bag, SortedBag and MultiMap though.
> 
> -Paul
> 
> 
> > -----Original Message-----
> > From: Jonathan Carlson [mailto:joncrlsn2@yahoo.com]
> > Sent: Monday, June 10, 2002 11:53 AM
> > To: commons-dev@jakarta.apache.org
> > Subject: [Collections] ReadOnly Collection decorators
> > 
> > 
> > I'd really like to see some ReadOnly Collection
> decorators
> > for all of the Collection and Iterator interfaces and
> > subinterfaces.  
> > 
> > When I return a collection or iterator from a framework
> I
> > don't want to trust that no one will modify those
> > collections if they represent something internal. 
> Using
> > these have protected me from even my own carelessness
> at
> > least once.
> > 
> > I have written a few already that I could share (Set,
> List,
> > Map, Iterator etc) but they don't subclass the commons
> > collections Proxy* classes (see my previous note on the
> > naming of these), which they probably should do if they
> are
> > to be included.
> > 
> > Thoughts anyone?
> > 
> > Jonathan
> > 
> > =====
> > Jonathan Carlson
> > joncrlsn@users.sf.net
> > Minneapolis, Minnesota
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! - Official partner of 2002 FIFA World Cup
> > http://fifaworldcup.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:   
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:  
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
> 


=====
Jonathan Carlson
joncrlsn@users.sf.net
Minneapolis, Minnesota

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message