Here you can find the source of reverseLabelMap(Map
public static <T> Map<Double, T> reverseLabelMap(Map<T, Double> labelMap)
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; public class Main { public static <T> Map<Double, T> reverseLabelMap(Map<T, Double> labelMap) { Map<Double, T> revMap = new HashMap<Double, T>(); for (T k : labelMap.keySet()) { revMap.put(labelMap.get(k), k); }/*from w ww.j a v a 2s . c o m*/ return revMap; } }