Creates a new
ListMultimap that uses the provided map and factory.
It can generate a multimap based on arbitrary
Map and
Listclasses.
The
factory-generated and
map classes determine the
multimap iteration order. They also specify the behavior of the
equals,
hashCode, and
toString methods for the
multimap and its returned views. The multimap's
get,
removeAll, and
replaceValues methods return
RandomAccesslists if the factory does. However, the multimap's
get method
returns instances of a different class than does
factory.get().
The multimap is serializable if
map,
factory, the
lists generated by
factory, and the multimap contents are all
serializable.
The multimap is not threadsafe when any concurrent operations update the
multimap, even if
map and the instances generated by
factory are. Concurrent read operations will work correctly. To
allow concurrent update operations, wrap the multimap with a call to
#synchronizedListMultimap.
Call this method only when the simpler methods
ArrayListMultimap#create() and
LinkedListMultimap#create()won't suffice.
Note: the multimap assumes complete ownership over of
map and
the lists returned by
factory. Those objects should not be manually
updated, they should be empty when provided, and they should not use soft,
weak, or phantom references.