A MultiMap
is a Map with slightly different semantics. Putting a value into the map will add the value to a Collection at that key. Getting a value will return a Collection, holding all the values put to that key.
This implementation is a decorator, allowing any Map implementation to be used as the base.
In addition, this implementation allows the type of collection used for the values to be controlled. By default, an ArrayList
is used, however a Class
to instantiate may be specified, or a factory that returns a Collection
instance.
Note that MultiValueMap is not synchronized and is not thread-safe. If you wish to use this map from multiple threads concurrently, you must use appropriate synchronization. This class may throw exceptions when accessed by concurrent threads without synchronization. @author James Carman @author Christopher Berry @author James Strachan @author Steve Downey @author Stephen Colebourne @author Julien Buret @author Serhiy Yevtushenko @version $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $ @since Commons Collections 3.2
A MultiMap
is a Map with slightly different semantics. Putting a value into the map will add the value to a Collection at that key. Getting a value will return a Collection, holding all the values put to that key.
This implementation is a decorator, allowing any Map implementation to be used as the base.
In addition, this implementation allows the type of collection used for the values to be controlled. By default, an ArrayList
is used, however a Class
to instantiate may be specified, or a factory that returns a Collection
instance.
Note that MultiValueMap is not synchronized and is not thread-safe. If you wish to use this map from multiple threads concurrently, you must use appropriate synchronization. This class may throw exceptions when accessed by concurrent threads without synchronization. @since 3.2 @version $Id: MultiValueMap.java 1479407 2013-05-05 22:07:53Z tn $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|