Skip to content
Prev Previous commit
Next Next commit
添加上下文链接
  • Loading branch information
maskleo committed Apr 19, 2018
commit 4f4561ff6b9d730fcfb07d12c6ad23345d55c206
7 changes: 4 additions & 3 deletions ch16/01_Using_the_Methods_of_Map.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


《《《 [返回首页](../README.md) <br/>
《《《 [上一节](00_Maps.md)

## 使用 Map 的方法

Expand Down Expand Up @@ -68,4 +68,5 @@

这两种方法的成本都是 `O(n)`,`Sun` 在当前的实施中具有类似的常数因子。


《《《 [下一节](02_Implementing_Map.md) <br/>
《《《 [返回首页](../README.md)
6 changes: 4 additions & 2 deletions ch16/02_Implementing_Map.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

《《《 [返回首页](../README.md) <br/>
《《《 [上一节](01_Using_the_Methods_of_Map.md)

## 实现 Map

Expand Down Expand Up @@ -145,4 +146,5 @@

`EnumMap` 包含一个特定的键类型,它在运行时用于检查添加到地图的新条目的有效性。 这种类型由三种构造函数以不同的方式提供。 首先,它是作为一个类别令牌提供的; 在第二个中,它是从指定的 `EnumMap` 复制的。 在第三种情况下,有两种可能性:指定的 `Map` 实际上是一个 `EnumMap`,在这种情况下,它的行为与第二个构造函数类似,或者使用指定 `Map` 的第一个键的类(这就是为什么提供的 `Map` 可能不会空着)。


《《《 [下一节](03_SortedMap_and_NavigableMap.md) <br/>
《《《 [返回首页](../README.md)
7 changes: 4 additions & 3 deletions ch16/03_SortedMap_and_NavigableMap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


《《《 [返回首页](../README.md) <br/>
《《《 [上一节](02_Implementing_Map.md)

## SortedMap 和 NavigableMap

Expand Down Expand Up @@ -117,4 +117,5 @@

`TreeMap` 与 `TreeSet` 具有相似的性能特征:基本操作(`get`,`put` 和 `remove`)在 `O(log n)` 时间执行)。 集合视图迭代器是快速失败的。


《《《 [下一节](04_ConcurrentMap.md) <br/>
《《《 [返回首页](../README.md)
8 changes: 4 additions & 4 deletions ch16/04_ConcurrentMap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


《《《 [返回首页](../README.md) <br/>
《《《 [上一节](03_SortedMap_and_NavigableMap.md)

## ConcurrentMap

Expand Down Expand Up @@ -31,5 +31,5 @@

忽略刚刚描述的锁定开销,`ConcurrentHashMap` 的操作成本类似于 `HashMap` 的操作成本。集合视图返回弱一致的迭代器。



《《《 [下一节](05_ConcurrentNavigableMap.md) <br/>
《《《 [返回首页](../README.md)
6 changes: 4 additions & 2 deletions ch16/05_ConcurrentNavigableMap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


《《《 [返回首页](../README.md) <br/>
《《《 [上一节](04_ConcurrentMap.md)

## ConcurrentNavigableMap

Expand All @@ -13,3 +13,5 @@

`ConcurrentSkipListMap` 和 `ConcurrentSkipListSet` 之间的关系类似于 `TreeMap` 和 `TreeSet` 之间的关系;`ConcurrentSkipListSet` 由 `ConcurrentSkipListMap` 实现,其中每个键与相同的标准值相关联,所以第 `13.2.3` 节中给出的跳过列表实现的机制和性能在这里同样适用:基本操作(`get`,`put` 和 `remove`) 在 `O(log n)` 时间执行); 集合视图上的迭代器会在下一个时间内执行。这些迭代器是快速失败的。

《《《 [下一节](06_Comparing_Map_Implementations.md) <br/>
《《《 [返回首页](../README.md)
8 changes: 4 additions & 4 deletions ch16/06_Comparing_Map_Implementations.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


《《《 [返回首页](../README.md) <br/>
《《《 [上一节](05_ConcurrentNavigableMap.md)

## 比较 Map 的实现

Expand All @@ -23,5 +23,5 @@ ConcurrentSkipListMap| O(log n)| O(log n)| O(1)|

这就为通用地图留下了实施的选择。 对于并发应用程序,`ConcurrentHashMap` 是唯一的选择。 否则,如果您需要使用映射的插入或访问顺序(例如,将其用作缓存),则可以优先使用 `HashMap` 上的 `LinkedHashMap`(并接受其稍差的性能)。



《《《 [下一节](../ch17/00_The_Collections_Class.md) <br/>
《《《 [返回首页](../README.md)