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 
org.apache.commons.collections.DoubleOrderedMap:

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:

FastBag
FastCollection
FastList
FastMap
FastSet
FastSortedSet
FastSortedMap

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.

Thoughts?

-Paul

============================================
Paul Jack
Database Administrator
San Francisco AIDS Foundation
[EMAIL PROTECTED]
(415)487-3075

"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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to