Java Map Reverse reverseKeyAndValue(Map map)

Here you can find the source of reverseKeyAndValue(Map map)

Description

reverse Key And Value

License

Apache License

Declaration

public static Map reverseKeyAndValue(Map map) 

Method Source Code

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

import java.util.HashMap;

import java.util.Map;
import java.util.Set;

import java.util.Map.Entry;

public class Main {

    public static Map reverseKeyAndValue(Map map) {
        Map reverseMap = new HashMap();
        for (Entry entry : (Set<Entry>) map.entrySet()) {
            reverseMap.put(entry.getValue(), entry.getKey());
        }//from  w w  w . j av  a 2  s. c om
        return reverseMap;
    }
}

Related

  1. reverse(Map source, Map target)
  2. reverse(Map source)
  3. reverse(Map source)
  4. reverse_map(Map map)
  5. reverse_map(Map map)
  6. reverseLabelMap(Map labelMap)
  7. reverseMap(List listSeq)
  8. reverseMap(Map map)
  9. reverseMap(Map map)