This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi There is a LinkedList with elements which have a key and a value. For example., List ls contains 1=one 2=two 3=three I want this to be mapped as HashMap hm = {1=one, 2=two, 3=three} How do I do that? Thanks in advance Vidu
chi Lin
Ranch Hand
Joined: Aug 24, 2001
Posts: 348
posted
0
Use StringTokenizer to parse the elements of the LinkedList, use "=" as delimiter. for each element, first token : key 2nd token : value put the (key, value) into the map
not so smart guy still curious to learn new stuff every now and then
vidu mayur
Ranch Hand
Joined: Nov 13, 2003
Posts: 32
posted
0
Thanks a lot! That worked perfectly!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.