• Post Reply Bookmark Topic Watch Topic
  • New Topic

Map with duplicate keys  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a Map implementation that allows duplicate keys? I wand to use it for storing parameters and their values, and some parameters can have same names.
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I answered this here
 
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could make the data portion a List and store multiple entries that way. If the Map already contains a key then you could simply add the additional String to the List.
[smilies inserted by Beth(me!)]
[ May 29, 2003: Message edited by: Thomas Paul ]
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is another link. it is about c++, but the idea should remain the same.
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!