Java Map Put putMultiEntry(Map map, Iterable keys, V value)

Here you can find the source of putMultiEntry(Map map, Iterable keys, V value)

Description

Convenient method to put several entry in a map having the same value at once.

License

Apache License

Declaration

public static <K, V> void putMultiEntry(Map<K, V> map,
        Iterable<K> keys, V value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Map;

public class Main {
    /**//from   w w  w.  ja va  2  s.  c  o  m
     * Convenient method to put several entry in a map having the same value at once.
     */
    public static <K, V> void putMultiEntry(Map<K, V> map,
            Iterable<K> keys, V value) {
        for (final K key : keys) {
            map.put(key, value);
        }
    }
}

Related

  1. putMapByPair(String pair, Map m)
  2. putMapEntry(Map map, String name, String value)
  3. putMapNotNullKey(Map map, K key, V value)
  4. putMapValue(String path, Object value, Map map)
  5. putModifiedAttribute(Map aMap, String name, Object value)
  6. putMultiple(Map map, Object key, Object value)
  7. putNotDup(Map tbl, String key, String value)
  8. putObject(Map map, V key, W value)
  9. putObjectsInMultiMap(Map>> multiMap, Integer key, List stringPair)