Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using a sorted map...

 
Greg Walker
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone show me an easy example of storing items in a sorted map? (The java tutorial is kinda confusing)
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Produces the output
 
Greg Walker
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now what if I wanted to do a one-to-many mapping, such as a group name <K> mapped to group numbers <V>, in which the values will be stored in a List?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://jakarta.apache.org/commons/collections/apidocs/org/apache/commons/collections/map/MultiValueMap.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic