• Post Reply Bookmark Topic Watch Topic
  • New Topic

Assigning iterators  RSS feed

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a collection,which basically stores the nodes of an xml in sequence.
The xml is like this:
<group id="a">
<event>xx</event>
<action>yyy</action>
.....
.....
</group>
<group id="b">
<event>XX</event>
..........
.....
</group>
Each line is an entry in the ArrayList.
I have a ListIterator to iterator down till I find '</group>' entry.
At this point,i wish to open another iterator to traverse backward from this index.
It traverses backward to find the nearest 'event' entry.
This should not upset the index pointed to by the original iterator.
Is this possible.
Is there an easier solution to this?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you got the first ListIterator from a List. To get a second, independent ListIterator at the same position as the current ListIterator, try this:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!