HasNextIterator<E> class final

Wrapper for Iterator providing the pre-Dart 1.0 iterator interface.

This class should not be used in new code.

The HasNextIterator class wraps an Iterator and provides methods to iterate over an object using hasNext and next.

The HasNextIterator does not implement the Iterator interface.

This class was intended for migration to the current Iterator interface, from an earlier interface using hasNext and next. The API change happened in the Dart 1.0 release. Any other use of this class should be migrated to using the current API directly, e.g., using a separate variable to cache the Iterator.moveNext result, so that hasNext can be checked multiple times.

  • @Deprecated("Will be removed in a later version of the Dart SDK")


HasNextIterator(Iterator<E> iterator)


hashCode int
The hash code for this object.
no setterinherited
hasNext bool
Whether the iterator has a next element.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


next() → E
Provides the next element of the iterable, and moves past it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.