• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

adding a bunch of list to a set

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
say i have a Map, a HashMap

and its key is a bunch of Integer and the values is a List of strings. i.e.


then i have a Set that stores a list and it looks like this:



from the above set we can see that in the first list is ["A", "B", "C", "D", "F", "G" ]

and this list belongs matchest the value in the map with the key 1 and 3.

for the second list in the set ["A", "B", "E", "D", "F", "G"], this list matchest the value in the map with the key 2 and 3

i've built up a rough code to build the map and the setOfList, see code,



anyone can help me solve this,

thanks
[ October 03, 2006: Message edited by: Firman Drage ]
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if I had to do it, I would have done this to load the lists;

With JDK 1.5:



With JDK 1.4


Now, I do not clearly understand the rest of your algoritm or its purpose.

I hope that helps!
[ October 03, 2006: Message edited by: Edwin Dalorzo ]
 
Alas, poor Yorick, he knew this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic