@Immutable public class ZipWithIndexIterable<T> extends AbstractLazyIterable<com.gs.collections.api.tuple.Pair<T,java.lang.Integer>>
| Constructor and Description |
|---|
ZipWithIndexIterable(java.lang.Iterable<T> iterable) |
| Modifier and Type | Method and Description |
|---|---|
void |
forEach(com.gs.collections.api.block.procedure.Procedure<? super com.gs.collections.api.tuple.Pair<T,java.lang.Integer>> procedure)
The procedure is executed for each element in the iterable.
|
<P> void |
forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super com.gs.collections.api.tuple.Pair<T,java.lang.Integer>,? super P> procedure,
P parameter)
The procedure2 is evaluated for each element in the iterable with the specified parameter provided
as the second argument.
|
void |
forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super com.gs.collections.api.tuple.Pair<T,java.lang.Integer>> objectIntProcedure)
Iterates over the iterable passing each element and the current relative int index to the specified instance of
ObjectIntProcedure
|
java.util.Iterator<com.gs.collections.api.tuple.Pair<T,java.lang.Integer>> |
iterator() |
aggregateBy, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collect, collectBoolean, collectBoolean, collectByte, collectByte, collectChar, collectChar, collectDouble, collectDouble, collectFloat, collectFloat, collectIf, collectIf, collectInt, collectInt, collectLong, collectLong, collectShort, collectShort, collectWith, collectWith, concatenate, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectWith, detectWithIfNone, distinct, drop, flatCollect, flatCollect, getFirst, getLast, groupBy, groupBy, groupByEach, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, partition, partitionWith, reject, reject, rejectWith, rejectWith, select, select, selectInstancesOf, selectWith, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, take, toArray, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toStack, toString, zip, zip, zipWithIndex, zipWithIndexpublic ZipWithIndexIterable(java.lang.Iterable<T> iterable)
public java.util.Iterator<com.gs.collections.api.tuple.Pair<T,java.lang.Integer>> iterator()
public void forEach(com.gs.collections.api.block.procedure.Procedure<? super com.gs.collections.api.tuple.Pair<T,java.lang.Integer>> procedure)
com.gs.collections.api.InternalIterablee.g. people.forEach(new Procedure() { public void value(Person person) { LOGGER.info(person.getName()); } });
public void forEachWithIndex(com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super com.gs.collections.api.tuple.Pair<T,java.lang.Integer>> objectIntProcedure)
com.gs.collections.api.InternalIterablee.g. people.forEachWithIndex(new ObjectIntProcedure() { public void value(Person person, int index) { LOGGER.info("Index: " + index + " person: " + person.getName()); } });
public <P> void forEachWith(com.gs.collections.api.block.procedure.Procedure2<? super com.gs.collections.api.tuple.Pair<T,java.lang.Integer>,? super P> procedure, P parameter)
com.gs.collections.api.InternalIterablee.g. people.forEachWith(new Procedure2() { public void value(Person person, Person other) { if (person.isRelatedTo(other)) { LOGGER.info(person.getName()); } } }, fred);