Home | History | Annotate | Download | only in collect

Lines Matching refs:multimap

48  * Provides static methods acting on or generating a {@code Multimap}.
60 * Creates a new {@code Multimap} that uses the provided map and factory. It
61 * can generate a multimap based on arbitrary {@link Map} and
65 * multimap iteration order. They also specify the behavior of the
67 * multimap and its returned views. However, the multimap's {@code get}
71 * <p>The multimap is serializable if {@code map}, {@code factory}, the
72 * collections generated by {@code factory}, and the multimap contents are all
75 * <p>The multimap is not threadsafe when any concurrent operations update the
76 * multimap, even if {@code map} and the instances generated by
78 * allow concurrent update operations, wrap the multimap with a call to
87 * <p>Note: the multimap assumes complete ownership over of {@code map} and
97 public static <K, V> Multimap<K, V> newMultimap(Map<K, Collection<V>> map,
139 * It can generate a multimap based on arbitrary {@link Map} and {@link List}
143 * multimap iteration order. They also specify the behavior of the
145 * multimap and its returned views. The multimap's {@code get}, {@code
147 * lists if the factory does. However, the multimap's {@code get} method
150 * <p>The multimap is serializable if {@code map}, {@code factory}, the
151 * lists generated by {@code factory}, and the multimap contents are all
154 * <p>The multimap is not threadsafe when any concurrent operations update the
155 * multimap, even if {@code map} and the instances generated by
157 * allow concurrent update operations, wrap the multimap with a call to
164 * <p>Note: the multimap assumes complete ownership over of {@code map} and
214 * It can generate a multimap based on arbitrary {@link Map} and {@link Set}
218 * multimap iteration order. They also specify the behavior of the
220 * multimap and its returned views. However, the multimap's {@code get}
224 * <p>The multimap is serializable if {@code map}, {@code factory}, the
225 * sets generated by {@code factory}, and the multimap contents are all
228 * <p>The multimap is not threadsafe when any concurrent operations update the
229 * multimap, even if {@code map} and the instances generated by
231 * allow concurrent update operations, wrap the multimap with a call to
239 * <p>Note: the multimap assumes complete ownership over of {@code map} and
289 * factory. It can generate a multimap based on arbitrary {@link Map} and
293 * multimap iteration order. They also specify the behavior of the
295 * multimap and its returned views. However, the multimap's {@code get}
299 * <p>The multimap is serializable if {@code map}, {@code factory}, the
300 * sets generated by {@code factory}, and the multimap contents are all
303 * <p>The multimap is not threadsafe when any concurrent operations update the
304 * multimap, even if {@code map} and the instances generated by
306 * allow concurrent update operations, wrap the multimap with a call to
313 * <p>Note: the multimap assumes complete ownership over of {@code map} and
373 * @param source any multimap
374 * @param dest the multimap to copy into; usually empty
377 public static <K, V, M extends Multimap<K, V>> M invertFrom(
378 Multimap<? extends V, ? extends K> source, M dest) {
386 * Returns a synchronized (thread-safe) multimap backed by the specified
387 * multimap. In order to guarantee serial access, it is critical that
388 * <b>all</b> access to the backing multimap is accomplished through the
389 * returned multimap.
392 * multimap when accessing any of its collection views: <pre> {@code
394 * Multimap<K, V> m = Multimaps.synchronizedMultimap(
408 * <p>Note that the generated multimap's {@link Multimap#removeAll} and
409 * {@link Multimap
412 * <p>The returned multimap will be serializable if the specified multimap is
415 * @param multimap the multimap to be wrapped in a synchronized view
416 * @return a synchronized view of the specified multimap
418 public static <K, V> Multimap<K, V> synchronizedMultimap(
419 Multimap<K, V> multimap) {
420 return Synchronized.multimap(multimap, null);
424 * Returns an unmodifiable view of the specified multimap. Query operations on
425 * the returned multimap "read through" to the specified multimap, and
426 * attempts to modify the returned multimap, either directly or through the
427 * multimap's views, result in an {@code UnsupportedOperationException}.
429 * <p>Note that the generated multimap's {@link Multimap#removeAll} and
430 * {@link Multimap#replaceValues} methods return collections that are
433 * <p>The returned multimap will be serializable if the specified multimap is
436 * @param delegate the multimap for which an unmodifiable view is to be
438 * @return an unmodifiable view of the specified multimap
440 public static <K, V> Multimap<K, V> unmodifiableMultimap(
441 Multimap<K, V> delegate) {
447 final Multimap<K, V> delegate;
454 UnmodifiableMultimap(final Multimap<K, V> delegate) {
458 @Override protected Multimap<K, V> delegate() {
548 public boolean putAll(Multimap<? extends K, ? extends V> multimap) {
688 * specified multimap.
692 * <p>The returned multimap will be serializable if the specified multimap is
695 * @param multimap the multimap to be wrapped
696 * @return a synchronized view of the specified multimap
699 SetMultimap<K, V> multimap) {
700 return Synchronized.setMultimap(multimap, null);
705 * operations on the returned multimap "read through" to the specified
706 * multimap, and attempts to modify the returned multimap, either directly or
707 * through the multimap's views, result in an
710 * <p>Note that the generated multimap's {@link Multimap#removeAll} and
711 * {@link Multimap#replaceValues} methods return collections that are
714 * <p>The returned multimap will be serializable if the specified multimap is
717 * @param delegate the multimap for which an unmodifiable view is to be
719 * @return an unmodifiable view of the specified multimap
728 * the specified multimap.
732 * <p>The returned multimap will be serializable if the specified multimap is
735 * @param multimap the multimap to be wrapped
736 * @return a synchronized view of the specified multimap
739 synchronizedSortedSetMultimap(SortedSetMultimap<K, V> multimap) {
740 return Synchronized.sortedSetMultimap(multimap, null);
745 * Query operations on the returned multimap "read through" to the specified
746 * multimap, and attempts to modify the returned multimap, either directly or
747 * through the multimap's views, result in an
750 * <p>Note that the generated multimap's {@link Multimap#removeAll} and
751 * {@link Multimap#replaceValues} methods return collections that are
754 * <p>The returned multimap will be serializable if the specified multimap is
757 * @param delegate the multimap for which an unmodifiable view is to be
759 * @return an unmodifiable view of the specified multimap
768 * specified multimap.
772 * @param multimap the multimap to be wrapped
773 * @return a synchronized view of the specified multimap
776 ListMultimap<K, V> multimap) {
777 return Synchronized.listMultimap(multimap, null);
782 * operations on the returned multimap "read through" to the specified
783 * multimap, and attempts to modify the returned multimap, either directly or
784 * through the multimap's views, result in an
787 * <p>Note that the generated multimap's {@link Multimap#removeAll} and
788 * {@link Multimap#replaceValues} methods return collections that are
791 * <p>The returned multimap will be serializable if the specified multimap is
794 * @param delegate the multimap for which an unmodifiable view is to be
796 * @return an unmodifiable view of the specified multimap
824 * Returns an unmodifiable view of the specified multimap {@code asMap} entry.
928 * Returns a multimap view of the specified map. The multimap is backed by the
929 * map, so changes to the map are reflected in the multimap, and vice versa.
930 * If the map is modified while an iteration over one of the multimap's
935 * <p>The multimap supports mapping removal, which removes the corresponding
939 * <p>The returned multimap will be serializable if the specified map is
942 * @param map the backing map for the returned multimap view
1018 public boolean putAll(Multimap<? extends K, ? extends V> multimap) {
1071 if (object instanceof Multimap) {
1072 Multimap<?, ?> that = (Multimap<?, ?>) object;
1181 * values. Each value will be stored as a value in the resulting multimap,
1182 * yielding a multimap with the same size as the input iterable. The key used
1183 * to store that value in the multimap will be the result of calling the
1184 * function on that value. The resulting multimap is created as an immutable
1193 * Multimap<Integer, String> index
1201 * <p>The returned multimap is serializable if its keys and values are all