499 B
499 B
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.(它提供一种方法访问一个容器对象中各个元素,而又不需暴露该对象的内部细节。)
- Iterator 抽象迭代器
- Concretelterator 具体迭代器
- Aggregate 抽象容器
- Concrete Aggregate 具体容器
开发系统时,迭代器的删除方法应该完成两个逻辑:一是删除当前元素,二是当前游标指向下一个元素