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

public Class FlatCollectIterable<T, V>

extends AbstractLazyIterable<V>
Class Inheritance
Imports
java.util.Iterator, .Optional, org.eclipse.collections.api.block.function.Function, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.impl.block.factory.Predicates, org.eclipse.collections.impl.block.procedure.AdaptObjectIntProcedureToProcedure, org.eclipse.collections.impl.lazy.iterator.FlatCollectIterator, org.eclipse.collections.impl.utility.Iterate

Field Summary

Modifier and TypeField and Description
private final Iterable<T>
private final Function<? super T, ? extends Iterable<V>>

Constructor Summary

AccessConstructor and Description
public
FlatCollectIterable(Iterable<T> newAdapted, Function<? super T, ? extends Iterable<V>> function)

Method Summary

Modifier and TypeMethod and Description
public boolean
allSatisfy(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.allSatisfy.

Implements org.eclipse.collections.api.RichIterable.allSatisfy.

Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty.

public <P> boolean
allSatisfyWith(Predicate2<? super V, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.allSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.allSatisfyWith.

Returns true if the predicate evaluates to true for every element of the collection, or returns false.

public boolean
anySatisfy(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.anySatisfy.

Implements org.eclipse.collections.api.RichIterable.anySatisfy.

Returns true if the predicate evaluates to true for any element of the iterable.

public <P> boolean
anySatisfyWith(Predicate2<? super V, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.anySatisfyWith.

Implements org.eclipse.collections.api.RichIterable.anySatisfyWith.

Returns true if the predicate evaluates to true for any element of the collection, or return false.

public V
detect(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detect.

Implements org.eclipse.collections.api.RichIterable.detect.

Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true.

public Optional<V>
detectOptional(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detectOptional.

Implements org.eclipse.collections.api.RichIterable.detectOptional.

Returns the first element of the iterable for which the predicate evaluates to true as an Optional.

public void
each(Procedure<? super V> procedure)

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

The procedure is executed for each element in the iterable.

public <P> void
forEachWith(Procedure2<? super V, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super V> objectIntProcedure)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

public Iterator<V>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public boolean
noneSatisfy(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.noneSatisfy.

Implements org.eclipse.collections.api.RichIterable.noneSatisfy.

Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty.

public <P> boolean
noneSatisfyWith(Predicate2<? super V, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.noneSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.noneSatisfyWith.

Returns true if the predicate evaluates to false for every element of the collection, or return false.

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

Field Detail

adaptedback to summary
private final Iterable<T> adapted
functionback to summary
private final Function<? super T, ? extends Iterable<V>> function

Constructor Detail

FlatCollectIterableback to summary
public FlatCollectIterable(Iterable<T> newAdapted, Function<? super T, ? extends Iterable<V>> function)

Method Detail

allSatisfyback to summary
public boolean allSatisfy(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.allSatisfy.

Implements org.eclipse.collections.api.RichIterable.allSatisfy.

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

Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty. Otherwise, returns false.

Annotations
@Override
allSatisfyWithback to summary
public <P> boolean allSatisfyWith(Predicate2<? super V, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.allSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.allSatisfyWith.

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

Returns true if the predicate evaluates to true for every element of the collection, or returns false.

Annotations
@Override
anySatisfyback to summary
public boolean anySatisfy(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.anySatisfy.

Implements org.eclipse.collections.api.RichIterable.anySatisfy.

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

Returns true if the predicate evaluates to true for any element of the iterable. Returns false if the iterable is empty, or if no element returned true when evaluating the predicate.

Annotations
@Override
anySatisfyWithback to summary
public <P> boolean anySatisfyWith(Predicate2<? super V, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.anySatisfyWith.

Implements org.eclipse.collections.api.RichIterable.anySatisfyWith.

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

Returns true if the predicate evaluates to true for any element of the collection, or return false. Returns false if the collection is empty.

Annotations
@Override
detectback to summary
public V detect(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detect.

Implements org.eclipse.collections.api.RichIterable.detect.

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

Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true. This method is commonly called find.

Example using a Java 8 lambda expression:

Person person =
    people.detect(person -> person.getFirstName().equals("John") && person.getLastName().equals("Smith"));
Annotations
@Override
detectOptionalback to summary
public Optional<V> detectOptional(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.detectOptional.

Implements org.eclipse.collections.api.RichIterable.detectOptional.

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

Returns the first element of the iterable for which the predicate evaluates to true as an Optional. This method is commonly called find.

Example using a Java 8 lambda expression:

Person person =
    people.detectOptional(person -> person.getFirstName().equals("John") && person.getLastName().equals("Smith"));

Annotations
@Override
eachback to summary
public void each(Procedure<? super V> 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
forEachWithback to summary
public <P> void forEachWith(Procedure2<? super V, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

Doc from org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

Example using a Java 8 lambda:

people.forEachWith((Person person, Person other) ->
    {
        if (person.isRelatedTo(other))
        {
             LOGGER.info(person.getName());
        }
    }, fred);

Example using an anonymous inner class:

people.forEachWith(new Procedure2<Person, Person>()
{
    public void value(Person person, Person other)
    {
        if (person.isRelatedTo(other))
        {
             LOGGER.info(person.getName());
        }
    }
}, fred);
Annotations
@Override
forEachWithIndexback to summary
public void forEachWithIndex(ObjectIntProcedure<? super V> objectIntProcedure)

Overrides org.eclipse.collections.impl.AbstractRichIterable.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Doc from org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

Example using a Java 8 lambda:

people.forEachWithIndex((Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));

Example using an anonymous inner class:

people.forEachWithIndex(new ObjectIntProcedure<Person>()
{
    public void value(Person person, int index)
    {
        LOGGER.info("Index: " + index + " person: " + person.getName());
    }
});
Annotations
@Override
iteratorback to summary
public Iterator<V> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override
noneSatisfyback to summary
public boolean noneSatisfy(Predicate<? super V> predicate)

Overrides org.eclipse.collections.impl.AbstractRichIterable.noneSatisfy.

Implements org.eclipse.collections.api.RichIterable.noneSatisfy.

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

Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty. Otherwise, returns false.

Annotations
@Override
noneSatisfyWithback to summary
public <P> boolean noneSatisfyWith(Predicate2<? super V, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.AbstractRichIterable.noneSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.noneSatisfyWith.

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

Returns true if the predicate evaluates to false for every element of the collection, or return false. Returns true if the collection is empty.

Annotations
@Override