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
Post a Comment