mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-10-31 02:53:42 +00:00
Update 设计模式 - 迭代器.md
Client 与 Aggregate、Iterator 之间的关系改为依赖。
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
||||
### 类图
|
||||
- Aggregate 是聚合类,其中 createIterator() 方法可以产生一个 Iterator;
|
||||
- Iterator 主要定义了 hasNext() 和 next() 方法;
|
||||
- Client 组合了 Aggregate,为了迭代遍历 Aggregate,也需要组合 Iterator。
|
||||
- Client 依赖 Aggregate,为了迭代遍历 Aggregate,也需要依赖 Iterator。
|
||||
|
||||
<div align="center"> <img src="pics/dp-iterator.png" width="760px"/> </div><br>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user