permaculture playing cards*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Iterator Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Iterator Pattern" Watch "Iterator Pattern" New topic

Iterator Pattern

simorgh hossein

Joined: Sep 06, 2007
Posts: 1
Please explain Iterator Pattern in JAVA by a simple example,Thanks in advance
[ November 11, 2008: Message edited by: simorgh hossein ]

Beyond the seas there is a town<br />In which windows open to manifestation<br />There rooftops quarter pigeons that looks at the jets of human intelligence
Nitesh Kant

Joined: Feb 25, 2007
Posts: 1638

Iterator pattern is extensively used by all java Collection classes.
Nothing like going through the code and understanding yourself

apigee, a better way to API!
Sergey Arnaut

Joined: Nov 03, 2008
Posts: 7
The java implementationof iterator pattern allows user to traverse carious types of data sets without worrying about the underlying implementation of collection. Since clients simply interact with the iterator for themselves. Some will allow full access to the underlying data sets while others may restrict certain functionalities, such as removing items.

---- "Design patterns" by Jason McDonald

For example, just open in your JAVA_HOME or whait a few ours till I found my old examples
Sergey Arnaut

Joined: Nov 03, 2008
Posts: 7
Here is example:

Any questions?
I agree. Here's the link:
subject: Iterator Pattern
Similar Threads
Passed step 1 97%. Many thanks to the forum
Question about Iterator Pattern ?
Iterator Design Pattern
Pgination in java
Identify these patterns...