scan
Description:
Creates a new iterator that is initially pointing to seed. Then subsequent values are obtained after applying the function to previous value and the subsequent items.
The resulting iterator is always valid and it contains the seed value.
Note:
Default implementation uses stream.
Note:
When the method is called on Iterator, using the parent iterator is not allowed before the inner iterator Iterator.next returns false and then it points to its last element. The resulting iterator is Iterator.valid .
Parameters:
f |
Folding function |
seed |
original seed value |
Returns:
Iterator containing values of subsequent values of seed |