Java HashMap Copy copy(HashMap oldHashMap)

Here you can find the source of copy(HashMap oldHashMap)

Description

copy

License

Open Source License

Declaration

public static HashMap<Byte, String> copy(HashMap<Byte, String> oldHashMap) 

Method Source Code


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

import java.util.HashMap;

public class Main {
    public static HashMap<Byte, String> copy(HashMap<Byte, String> oldHashMap) {
        HashMap<Byte, String> newHashMap = new HashMap<Byte, String>();

        for (Byte b : oldHashMap.keySet()) {
            String str = oldHashMap.get(b);
            newHashMap.put(b, str);//w w w. j  a  va 2  s .  c o  m
        }

        return newHashMap;
    }
}

Related

  1. copyDirective(HashMap directives, StringBuilder sb, String directive)
  2. copyHashMap(final HashMap map)
  3. copyHashWords(HashMap> ohwords, HashMap> nhwords, int start, int end, int nstart)
  4. copyItem(HashMap to, HashMap from, String key)