public interface ArticleIterator extends Iterator
ArticleIterator articles = ...; // Retrive article iterator try { while (articles.hasNext()) { Article article = articles.nextArticle(); ... // Do stuff with article } } cacth (PersistenStoreException) { // Exit gracefully, or maybe try again later }Implementations should handle concurrent modifications gracefully. That is, new Articles added after creation time will not be iterated over, removed Articles are simply skipped.
Modifier and Type | Method and Description |
---|---|
Object |
next()
Returns the next Article in this Iterator.
|
Article |
nextArticle()
Returns the next Article in this Iterator.
|
forEachRemaining, hasNext, remove
Article nextArticle()
NoSuchElementException
- if the iteration has no more elements.Object next()
next
in interface Iterator
NoSuchElementException
- if the iteration has no more elements.nextArticle()
© 1998- 2018 Stibo DX