iterator abstract method

Iterator<T> iterator()

Returns an iterator for the elements of this stream.

This is a terminal operation.

API Note

This operation is provided as an "escape hatch" to enable arbitrary client-controlled pipeline traversals in the event that the existing operations are not sufficient to the task.

Example

final stream = DartStream.of([1, 2, 3, 4, 5]);
final iterator = stream.iterator();

while (iterator.moveNext()) {
  print(iterator.current);
}

Implementation

Iterator<T> iterator();