我有2张地图,如下所示
LinkedHashMap<String,String> m1 = new LinkedHashMap<String,String>();
Map<String,String> m2 = new HashMap<String,String>();
我需要从两个地图中获取值,但对于m2
,我必须得到范围介于第一和第二之间的范围(集合)... m1的第二和第三个关键字(可用m1个键)在m2)。我怎样才能做到这一点?
for(Map.Entry<String,String> m: m1.entrySet()){
String curKey = m.getKey();
String curVal = m.getValue();
//Write values in file
//get values with the range between start=curKey and end=nextKey from m2 map
//Write m2 map values in file
}