An Iterator is a design pattern used in software engineering. iterators allows access to the elements of an aggregate or collection data structure. Sometimes th
An Iterator is a design pattern used in software engineering. iterators allows access to the elements of an aggregate or collection data structure. Sometimes this pattern is also called cursor. Using the iterator, the elements of the data structure can be accessed sequentially, without exposing the implementation. Usually, iterators have methods to ask whether there is another item, and to get the next item. Depending on the implementation, they might also have methods for removing the current element or for finding the next element that meets certain criteria. In some implementations, iterators can only traverse data structures in one direction, while others allow traversal in both directions.
Iterators can be implemented in different ways:
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.