java - List Iterator next element of an element -


i'm working big set of data , using lists.
i'm using list iterators run through linked list, came across problem, have next element of next element.
dont want high specially working set 28k data.

so, using list iterator, theres way next element of next?

like this:

listiterator<type> iterator = mylist.listiterator() while(iterator.hasnext()){   iterator.next().next()?? } 

every loop of while give 2 objects , change each loop.

listiterator<type> iterator = mylist.listiterator() while(iterator.hasnext()){       object first= iterator.next();        if(iterator.hasnext())           object second= iterator.next();  } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -