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

public Class ChunkIterable<T>

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

A ChunkIterable is an iterable that partitions a source iterable into fixed size chunks as it iterates.

Field Summary

Modifier and TypeField and Description
private final Iterable<T>
private final int

Constructor Summary

AccessConstructor and Description
public
ChunkIterable(Iterable<T> iterable, int size)

Method Summary

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

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

The procedure is executed for each element in the iterable.

public Iterator<RichIterable<T>>
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
sizeback to summary
private final int size

Constructor Detail

ChunkIterableback to summary
public ChunkIterable(Iterable<T> iterable, int size)

Method Detail

eachback to summary
public void each(Procedure<? super RichIterable<T>> 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<RichIterable<T>> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override