SplitScript reference / MapIterator<I, S, U>
MapIterator<I, S, U>
type constructor
MapIterator<I where Iterator, S, U>
Lazily transforms the items of another iterator.
Create this adapter with Iterator.map. Calling Iterator.next advances its source cursor once and invokes the stored transformation only for an item step.
Examples
Store a mapped cursor
let iterator: MapIterator<ArrayIterator<u32>, u32, String> =
[1, 2].iterator().map(value => `{value}`)
Methods
| Member | Description | Available through |
|---|---|---|
| iterator | Returns this cursor without changing its current position. | |
| next | Advances and transforms one source item. |