From: "Noel J. Bergman" <[EMAIL PROTECTED]> > > > - ALL the Unmodifiable crap > > > I can understand this. The reason the classes exist is for > > completeness and practicality. [collections] has interfaces > > that are not in the JDK, and they need unmodifiable decorators > > Steve, this is where I was wondering about the approach used in the [events] > message posted today. Would that help, if applied consistently across > [collections]? Not really. Proxying would require a simple matching straegy.
However, each collection has its own tricks when it comes to writing decorators. For an unmodifiable map for example, you must trap the main map, the keySet, the values collection and the entrySet. Plus you must trap the setValue on exposed MapEntry objects from the entrySet iterator and the toArray. Sometime, I think this is what many people looking at collections don't appreciate. Implementing the collection interfaces, especially the maps, can be really hard. Stephen --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
