commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@carmanconsulting.com
Subject Re: [collections] New Collection
Date Fri, 12 Sep 2003 16:13:24 GMT
The only problem with SequencedHashMap is that its ordering is based upon
the insertion order, not the values of the objects added to it or some
Comparator, such as is needed (at least that's how I interpret "ordering by
value" from the original requirements).

----- Original Message ----- 
From: "Arun Thomas" <Arun.Thomas@solidusnetworks.com>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Friday, September 12, 2003 12:04 PM
Subject: RE: [collections] New Collection


You might want to take a look at
org.apache.commons.collections.SequencedHashMap which combines, for the most
part, the functions of list and map (insertElementAt()) is not available -
how does one insert a key, when the value should be at a specific position?

The transactional support is definitely not there, but this might give you a
better starting point for what you desire.

-AMT

-----Original Message-----
From: Oxley, David [mailto:David.Oxley@workplace-systems.plc.uk]
Sent: Friday, September 12, 2003 8:07 AM
To: 'commons-dev@jakarta.apache.org'
Subject: [collections] New Collection


Our application has just changed from requiring JDK 1.1 to JDK 1.3 as a
minimum. As a result we are looking at switching our implementation of using
Hashtable and Vector to using collections.

I am going to write a new collection that gives the functionality we require
and once I've finished I want to donate it to commons-collections. I would
like some comments on where to start (especially as I don't yet know too
much about the standard collections API's). The functionality I require is
this: 1. Keys and values. ala Hashtable. 2. Ordering by value. ala Vector.
3. Indexing by value. ala Vector's indexOf, elementAt and insertElementAt.
4. Transactions. i.e. Others won't see changes until commit is called.

I take it there is no implementation that supplies the above. I was
initially thinking of either encapsulating or overriding TreeMap, but I
think that would make the indexing part pretty difficult. But now I think I
will just encapsulate or override HashMap.

Any comments would be gratefully received.

Cheers.
Dave.
david.oxley@workplace-systems.plc.uk


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The service
is powered by MessageLabs. For more information on a proactive anti-virus
service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org




Mime
View raw message