- Java EE 8 Design Patterns and Best Practices
- Rhuan Rocha Jo?o Purifica??o
- 144字
- 2021-07-23 16:54:51
Explaining Iterator
Imagine that we want a way to access elements of an aggregate object sequentially without exposing its internal structure. The Iterator pattern does just that.
The Iterator pattern is responsible for sequentially accessing the aggregate object and defining an interface to access the elements without exposing the internal structure. This interface doesn't put a new element on the aggregate object, but simply reads elements to it. In the following diagram, you can see the structure of an Iterator and how it is designed:

In the preceding diagram, we can see the Aggregate and Iterator interfaces with their concrete subclasses. The client is the class that uses the Iterator to access elements of Aggregate.
This pattern is used on Java collections such as list, deque, and set. Understanding this pattern will help you to understand Java collections.
- Linux設備驅動開發詳解:基于最新的Linux4.0內核
- 全屋互聯:智能家居系統開發指南
- Mastering ElasticSearch
- 零起點學Linux系統管理
- 無蘋果不生活 OS X Mountain Lion隨身寶典
- Extending Bootstrap
- Application Development in iOS 7
- 嵌入式微系統
- 應急指揮信息系統設計
- Zabbix監控系統之深度解析和實踐
- Linux系統安全:縱深防御、安全掃描與入侵檢測
- 辦公自動化教程(Windows7+Office2010)
- Selenium Framework Design in Data-Driven Testing
- Windows10開發入門經典
- 深入理解嵌入式Linux設備驅動程序