A container is a list of either collections or iterators. A container iterator is a list of iterators, which correspond to the collections or iterators in the container. If the container has an iterator, then the container iterator uses that iterator directly. If the container has a collection, then the container iterator gets an iterator from the collection.
A sequence iterator is a container iterator that looks at the iterators in its list in order, starting with the first one and progressing to the last. There are two ways that a sequence iterator can traverse its iterators, either it can do a depth-first or a breadth-first traversal. With a depth-first traversal, each iteration returns a value from the first iterator in the list, until it is done. Then iteration gets values from the second iterator, etc, until the last value of the last iterator is returned. In a breadth-first traversal, the first value is returned from the each iterator in the list in turn, then the second value from each iterator, etc, until the last value of the last iterator is returned.
A parallel iterator is a container iterator that gets the next value from each iterator in its list in order, and returns the values in a value list. So on the first iteration, the value list has the first value from each iterator, on the second iteration, it has the second value from each iterator, etc.
There are two ways that hasNext() can return false for a parallel iterator, determined by its done
policy. When the policy is all, then false is returned only when all children return false. When the
policy is any, then false is returned when any child returns false. The default done policy is
all.
A counter iterator derives from a parallel iterator. It generates its first iterator until done, then it resets that one, generates the second once, and regenerates the first until done. This process continues until all iterators are done. For example, the values generated by two iterators over the list ints[0,2] would be (0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,2).