commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack, Paul" <pj...@sfaf.org>
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 
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
pjack@sfaf.org
(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:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message