convertAs<R> method
R
convertAs<R>(
- R initial,
- R combine(
- R value,
- E element
Implementation
R convertAs<R>(R initial, R Function(R value, E element) combine) {
Iterator<E> iterator = this.iterator;
if (!iterator.moveNext()) return initial;
R value = combine(initial, iterator.current);
while (iterator.moveNext()) {
value = combine(value, iterator.current);
}
return value;
}