Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I go through an Iterator mulitple times?

iterator mulitple times
0
Posted

How can I go through an Iterator mulitple times?

0

Location: http://www.jguru.com/faq/view.jsp?EID=532217 Created: Oct 28, 2001 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Question originally posed by Eric Tetz (http://www.jguru.com/guru/viewbio.jsp?EID=409815 There is no direct support for this. You’ll need to create your own caching mechanism. For instance, as you go through the Iterator the first time, add the elements to a LinkedList. Then, you can just get an Iterator from the LinkedList for the second pass through.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123