commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arron Bates" <>
Subject Re: [collections] - Few more collections for the masses... (impor tant for Struts view objects, maybe other projects)
Date Sun, 19 May 2002 02:46:31 GMT
> I think I'm with James on this one. Reserve is a name that makes sense for
> the List implementation, but not for the Map one. Lazy is about saying that
> the collection creates objects on demand if the entry is null, or rather if
> get method would have returned null (or for list if the get method is out of
> bounds).

I personally don't care about the colour of the bike shed.

> Viewed as a lazy instantiation group of collection proxies, I think that it
> could be useful for commons. Of the 8 possible types that have been
> mentioned, lazy instantiation is applicable to all. For LazyCollection, the
> only access is via an iterator. The iterator should loop through the
> collection and on the next() method should return a newly created object if
> it was about to return null. For LazyList the code remains roughly as you
> have it, except that DeadObject is relaced by null. And so on.

Nulls don't really work though. Do all list implementations allow null 
values?... Can we assume this?... I wasn't going to.

> Finally, I would implement the clean() method as a separate static method
> that removes null's from a Collection/Map.

A good idea. But also needs to clean dead items, unless there's a "yes" 
answer to the above question.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message