Java Map Copy copyOnWritePut(K k, V v, Map source)

Here you can find the source of copyOnWritePut(K k, V v, Map source)

Description

copy On Write Put

License

Apache License

Declaration

private static <K, V> Map<K, V> copyOnWritePut(K k, V v, Map<K, V> source) 

Method Source Code

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

import java.util.IdentityHashMap;

import java.util.Map;

public class Main {
    private static <K, V> Map<K, V> copyOnWritePut(K k, V v, Map<K, V> source) {
        Map<K, V> map = new IdentityHashMap<K, V>(source);
        map.put(k, v);//  ww w.j  av  a  2 s.  com
        return map;
    }
}

Related

  1. copyMapButFailOnNull(Map entries)
  2. copyMapWithoutEmpties(Map original)
  3. copyOf( Map> map)
  4. copyOf(final Map map)
  5. copyOf(Map src)
  6. copyOptions(Map options)
  7. copyParameters(Map parameters)
  8. copyPropertiesToMap(Properties source, Map target)
  9. copySafelyToObjectToObjectMap(java.util.Map map)