commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack, Paul" <>
Subject Further thoughts on FastArrayList, FastHashMap, FastTreeMap
Date Wed, 10 Apr 2002 22:28:20 GMT
Can we generalize?  It seems that FastHashMap
could just as easily accept any Map implementation
in its constructor.  In other words, it could work
just as well with java.util.IdentityHashMap or 
java.util.WeakHashMap or 

public class FastMap implements Map {
	public FastMap(Map m) { //... }

The implementation would be more or less the same,
but would allow you to use specialized maps in a 
fast thread-safe manner.  Seems users could benefit
from a composition model here.

Similar for FastArrayList and FastTreeMap.  In fact
we could create fast wrapper classes for all the basic
Java collection types and the commons' Bag:


Would be very useful, IMHO.  Sort of pollutes the 
package though (seven new classes!).  

I'd be happy to code them up since I sort of have
to do some of it anyway for a project I'm working on,
so if everyone thinks it's a good idea I'll do it.



Paul Jack
Database Administrator
San Francisco AIDS Foundation

"As far as we can discern, the sole purpose
of human existence is to kindle a light of
meaning in the darkness of mere being."
 --Carl Jung

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

View raw message