Home

# Class goog.iter.Iterator

Class/interface for iterators. An iterator needs to implement a {@code next} method and it needs to throw a {@code goog.iter.StopIteration} when the iteration passes beyond the end. Iterators have no {@code hasNext} method. It is recommended to always use the helper functions to iterate over the iterator or in case you are only targeting JavaScript 1.7 for in loops.

Instance Method Summary
| `__iterator__(boolean= opt_keys) ⇒ !goog.iter.Iterator` Returns the {@code Iterator} object itself. This is used to implement the iterator protocol in JavaScript 1.7
| `next() ⇒ <Any Type>` Returns the next value of the iteration. This will throw the object {@see goog.iter#StopIteration} when the iteration passes the end.