本段适用于使用
the special constructor创建的地图,该地图根据上次访问顺序(相对于标准LinkedHashMap的插入顺序)生成迭代顺序.
它只是说如果一个键K在地图中,你调用putAll(someOtherMap),其中someOtherMap也包含K,这将被视为对K的访问,它将被移动到地图的末尾(来自迭代顺序)透视).
换句话说,从访问角度来看,putAll等同于(条目e:条目)map.put(e); (伪代码).
举例:
public static void main(String[] args) throws Exception {
Map m = new LinkedHashMap<> (16, 0.75f, true);
m.put("a", "a");
m.put("b", "b");
System.out.println("m = " + m); // a, b
m.put("a", "a");
System.out.println("m = " + m); // b, a
Map m2 = new LinkedHashMap<>();
m2.put("b", "b");
m.putAll(m2);
System.out.println("m = " + m); // a, b: putAll was considered as an access
// and the order has changed
}