Stateful Iterators Java
Here is further information on stateful Iterator:
http://en.wikipedia.org/wiki/Iterator (look under Generators)
and some further information here:
http://www.itmaybeahack.com/book/python-2.6/html/p02/p02c08_generators.html
and finally here:
http://www.devdaily.com/java/jwarehouse/trove-1.1b3/src/gnu/trove/TIntIntIterator.java.shtml
As the iteration is stateful, access to the key/value parts of the current map entry happens in constant time.
Hope this helps.