Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

To iterate or not to iterate

843789Sep 16 2009 — edited Sep 24 2009
I have this code here:
if(!(prevStateIter.hasNext()))
{
    currentCumulativeProb = 0.0;
}
else
{
    //currentCumulativeProb
}
Now, I want to access next, but I don't want the iterator to iterate.
Am I using the wrong data structure? Can I use reflection? Can I declare something to clone this iterator and it's position?
Does anyone know what I can do to access "next()" without "nexting"?

Cheers.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 22 2009
Added on Sep 16 2009
36 comments
155 views