Java Map Clone clone(Map map1)

Here you can find the source of clone(Map map1)

Description

clone

License

Open Source License

Declaration

public static <K, V> Map<K, V> clone(Map<K, V> map1) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static <K, V> Map<K, V> clone(Map<K, V> map1) {
        Map<K, V> map2 = new HashMap<K, V>(map1.size());
        for (Map.Entry<K, V> e : map1.entrySet()) {
            map2.put(e.getKey(), e.getValue());
        }/*from  w ww  .  ja  v a2  s.  c  om*/
        return map2;
    }
}

Related

  1. clone(Map aMap)
  2. clone(Map from, Map to)
  3. clone(Map configurationValues)
  4. clone(Map origMap)
  5. clone(Map map)
  6. cloneDefaults(Map defaults)
  7. cloneMap(final Map m)