Java- Adding unique values to Hashmap -


ok,

here issue....i have list<short>letterlist has example: "1,2,3,4,5,6,7,8,9,10"

what im doing im iterating on list passing value method returns value:

so:

string value = null; for(short foo : letterlist)  {    value = getsomevalue(foo) //returns letter or b or c } 

what im trying hashmap this:

key: a, value 1,5,7 key b, value: 2,3,4 key c, value: 6,8,9,10 

not these values specifically, point

im not sure how have tried creating map <set<string>, list<short>

any suggestions appreciated

java has no built-in multimap, can either simulate multimap (map<string, list<short>>) or try out guava example: https://code.google.com/p/guava-libraries/


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -