Iterator<T> class
This interface defines properties and methods for iterating over a collection;
it provides the #next predicate and the #value read-only property.
Some Iterators also provide key
property values along with each value
.
Typical usage is:
var it = anIterableCollection.iterator;
while (it.next()) {
var item = it.value;
}
Many iterators will signal an error if #next is called after the underlying collection has been modified.
To avoid confusion when dealing with Iterables, iterators implement the Iterable#iterator property by just returning themselves.
- Implemented types
-
- Iterable<
T>
- Iterable<
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
- @anonymous
Constructors
Properties
- all ↔ bool Function(bool (T))
-
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair - any ↔ bool Function(bool (T))
-
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair - count → num
-
Available on Iterable<
This read-only property is the number of elements in the collection.T> , provided by the Iterable$Typings extensionno setter - count → num
-
Available on Iterator<
This read-only property is the total number of items in the iterated collection.T> , provided by the Iterator$Typings extensionno setter - each ↔ void Function(void (T))
-
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair -
filter
↔ Iterator<
T> Function(bool (T)) -
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair - first ↔ T? Function()
-
Available on Iterable<
T> , provided by the Iterable$Typings extensiongetter/setter pair - first ↔ T? Function()
-
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- hasNext ↔ bool Function()
-
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair -
iterator
↔ Iterator<
T> -
Available on Iterable<
Gets an Iterator that can iterate over the items in the collection.T> , provided by the Iterable$Typings extensiongetter/setter pair -
iterator
↔ Iterator<
T> -
Available on Iterator<
Returns itself, which is convenient for code that expects an Iterable instead of an Iterator. @return {Iterator.T> , provided by the Iterator$Typings extensiongetter/setter pair - key → dynamic
-
Available on Iterator<
Gets the current index to the item in the collection, assuming #next has just returned true.T> , provided by the Iterator$Typings extensionno setter -
map
↔ Iterator<
S> Function<S>(S (T)) -
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair - next ↔ bool Function()
-
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair - reset ↔ void Function()
-
Available on Iterator<
T> , provided by the Iterator$Typings extensiongetter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → T
-
Available on Iterator<
Gets the current item in the collection, assuming #next has just returned true.T> , provided by the Iterator$Typings extensionno setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited