Top Description Fields Constructors Methods
org.eclipse.collections.impl.lazy

public Class ZipWithIndexIterable<T>

extends AbstractLazyIterable<Pair<T, Integer>>
Class Inheritance
Imports
java.util.Iterator, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.lazy.iterator.ZipWithIndexIterator, org.eclipse.collections.impl.utility.internal.IterableIterate

A CollectIterable is an iterable that transforms a source iterable on a condition as it iterates.

Field Summary

Modifier and TypeField and Description
private final Iterable<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
each(Procedure<? super Pair<T, Integer>> procedure)

Implements org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

public Iterator<Pair<T, Integer>>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Inherited from org.eclipse.collections.impl.lazy.AbstractLazyIterable:
asLazychunkcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithconcatenatedistinctdropdropWhileflatCollectgetFirstgetLastgetOnlygroupBygroupByEachgroupByUniqueKeyintoisEmptymaxByOptionalmaxOptionalmaxOptionalminByOptionalminOptionalminOptionalpartitionpartitionWithrejectrejectWithselectselectInstancesOfselectWithsizesumByDoublesumByFloatsumByIntsumByLongtaketakeWhiletaptoStackzipzipWithIndex

Field Detail

iterableback to summary
private final Iterable<T> iterable

Constructor Detail

ZipWithIndexIterableback to summary
public ZipWithIndexIterable(Iterable<T> iterable)

Method Detail

eachback to summary
public void each(Procedure<? super Pair<T, Integer>> procedure)

Implements org.eclipse.collections.api.RichIterable.each.

Doc from org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

Example using a Java 8 lambda expression:

people.each(person -> LOGGER.info(person.getName()));
This method is a variant of InternalIterable#forEach(Procedure) that has a signature conflict with Iterable#forEach(java.util.function.Consumer).
Annotations
@Override
iteratorback to summary
public Iterator<Pair<T, Integer>> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override