Thanks for the reply. I found a solution by using Date, and
SimpleDateFormat class to do the sorting of the date fields:
String strDateFormat = "dd-MMM-yyyy";
SimpleDateFormat dfDate = new SimpleDateFormat(strDateFormat);
Date dateKey = null;
dateKey = dfDate.parse( datefield ); // datefield has the
string value "31-Jan-2005" etc.
Then I can put dateKey as part of the key in a TreeMap so that it can be
sorted. :)
Thank you.
"Thomas Dybdahl Ahle" <th****@localhost.localdomain> wrote in message
news:pa****************************@localhost.loca ldomain...
Den Tue, 04 Oct 2005 09:12:58 -0400. skrev andrew: I am already using TreeMap to massage records in my export file such
that each record has a unique key combination ( LastName + FirstName + Member
Key) . Thus I am sorting the records by the unique key. I also have a
Date String Field in my record ( ie "30-Apr-2005" ). I want to create a
unique key combination of
( LastName + FirstName + Member Key + Date).
What about making/using a method for turning dates into an int or long.
Then making a SortedMap using the number as key and string as value.
It's all about making/using a fast algorithm for the convertion.
--
Programmers should realize their critical importance and responsibility in
a world gone digital. They are in many ways similar to the priests and monks
of Europe's Dark Ages; they are the only ones with the training and insight
to read and interpret the "scripture" of this age.