IndexTrackingIterator

constructor(elements: List<T>)(source)

Creates an iterator starting at the beginning of the list.

Parameters

elements

the list to iterate over


constructor(elements: List<T>, fromIndex: Int)(source)

Creates an iterator starting at the specified index. The current index is initialized to -1, indicating that no element has been read yet.

Parameters

elements

the list to iterate over

fromIndex

the starting index (cursor position)

Throws

if fromIndex is out of range