Files
Hui-s-notebook/203-Java/203.1-Java面试/205.19-网络&操作系统/迭代器模式.md
2023-09-10 10:50:53 +08:00

499 B

Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.(它提供一种方法访问一个容器对象中各个元素,而又不需暴露该对象的内部细节。)

  • Iterator 抽象迭代器
  • Concretelterator 具体迭代器
  • Aggregate 抽象容器
  • Concrete Aggregate 具体容器

开发系统时,迭代器的删除方法应该完成两个逻辑:一是删除当前元素,二是当前游标指向下一个元素