sourceIterator property
A new Iterator
that allows iterating the elements of
the source Iterable.
Iteration classes should specify the iteration order of their elements. However, they may leave it unspecified for Set like behavior.
Each time sourceIterator
is read, it returns a new iterator,
which can be used to iterate through all the elements again.
The iterators of the same iterable can be stepped through independently,
but should return the same elements in the same order,
as long as the underlying collection isn't changed.
Modifying the collection may cause new iterators to produce different elements, and may change the order of existing elements.
Modifying the underlying collection after creating the new iterator may cause an error the next time Iterator.moveNext is called on that iterator. Any modifiable iterable class should specify which operations will break iteration.
Implementation
@override
Iterator<E> get sourceIterator => IteratorBuild<E>(
elementAt: sourceGet,
endIndex: sourceLength,
);