- Design Patterns and Best Practices in Java
- Kamalmeet Singh Adrian Ianculescu LUCIAN PAUL TORJE
- 111字
- 2021-06-25 20:52:37
The iterator pattern
The iterator pattern is probably one of the most well-known patterns in Java. Some Java programmers are using it without being aware that the collection package is an implementation of the iterator pattern, regardless of the type of the collection: array, list, set, or any other types.
The fact that we can deal in the same way with a collection, regardless of whether it's a list or an array, is because it provides a mechanism to iterate through its elements without exposing its internal structure. What's more, the same unified mechanism is used by different types of collections. The mechanism is called the iterator pattern.
推薦閱讀
- The Complete Rust Programming Reference Guide
- Debian 7:System Administration Best Practices
- Python自動(dòng)化運(yùn)維快速入門(mén)
- Mastering Python Scripting for System Administrators
- Java開(kāi)發(fā)入行真功夫
- Practical Windows Forensics
- 利用Python進(jìn)行數(shù)據(jù)分析(原書(shū)第3版)
- D3.js 4.x Data Visualization(Third Edition)
- UML 基礎(chǔ)與 Rose 建模案例(第3版)
- Keras深度學(xué)習(xí)實(shí)戰(zhàn)
- 基于ARM Cortex-M4F內(nèi)核的MSP432 MCU開(kāi)發(fā)實(shí)踐
- Delphi開(kāi)發(fā)典型模塊大全(修訂版)
- UML基礎(chǔ)與Rose建模實(shí)用教程(第三版)
- Applied Deep Learning with Python
- MATLAB/Simulink建模與仿真