Java Map Reverse reverse(Map kvMap)

Here you can find the source of reverse(Map kvMap)

Description

reverse

License

Open Source License

Declaration

public static <K, V> Map<V, K> reverse(Map<K, V> kvMap) 

Method Source Code


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

import java.util.*;

public class Main {
    public static <K, V> Map<V, K> reverse(Map<K, V> kvMap) {
        Map<V, K> vkMap = new HashMap<V, K>(kvMap.size());
        for (Map.Entry<K, V> e : kvMap.entrySet()) {
            vkMap.put(e.getValue(), e.getKey());
        }/* www.jav a  2  s .  c o m*/
        return vkMap;
    }
}

Related

  1. reverse( Map map)
  2. reverse(final Map map)
  3. reverse(Map source, Map target)
  4. reverse(Map source, Map target)
  5. reverse(Map in)
  6. reverse(Map map)
  7. reverse(Map map)
  8. reverse(Map source, Map target)
  9. reverse(Map source)