Adding Multiples Values from a Map

steelodon

Senior member
Oct 29, 2007
586
13
81
JAVA - I am trying to add multiple values assigned to a name in a Map. Any suggestions?
 

siftings81

Member
Sep 3, 2001
61
0
0
Look at the MultiMap from the Apache Commons Collections or Google Collections libraries.

If you don't want to use a library, then use something like Map<String, List<T>>.
 

Leros

Lifer
Jul 11, 2004
21,867
7
81
Look at the MultiMap from the Apache Commons Collections or Google Collections libraries.

If you don't want to use a library, then use something like Map<String, List<T>>.

Good advice. There are a lot of great collections libraries out there beyond the basic Java library. Trove and FastUtil are two that I use all the time.