DkIterableEachExt<E> extension
可迭代对象遍历功能扩展
- on
-
- Iterable<
E>
- Iterable<
Methods
-
forEachIndexed(
void action(int index, E element)) → void -
Available on Iterable<
带索引的遍历E> , provided by the DkIterableEachExt extension -
mapIndexed<
U> (U toElement(int index, E element)) → Iterable< U> -
Available on Iterable<
类似 map,但是有当前元素的索引。E> , provided by the DkIterableEachExt extension -
onEach(
void action(E element)) → Iterable< E> -
Available on Iterable<
将E> , provided by the DkIterableEachExt extensionaction应用于每个元素,返回整个未修改的 Iterable -
onEachIndexed(
void action(int index, E element)) → Iterable< E> -
Available on Iterable<
将E> , provided by the DkIterableEachExt extensionaction应用于每个元素,返回整个未修改的 Iterable ,action第二个参数index是元素索引位置。 -
sum(
num addend(E element)) → num -
Available on Iterable<
根据定义E> , provided by the DkIterableEachExt extensionaddend返回this中所有值的总和。