Class FlatCollectIntToObjectIterable<V>

java.lang.Object
org.eclipse.collections.impl.AbstractRichIterable<T>
org.eclipse.collections.impl.lazy.AbstractLazyIterable<V>
org.eclipse.collections.impl.lazy.primitive.FlatCollectIntToObjectIterable<V>
All Implemented Interfaces:
Iterable<V>, InternalIterable<V>, LazyIterable<V>, RichIterable<V>

public class FlatCollectIntToObjectIterable<V> extends AbstractLazyIterable<V>
This file was automatically generated from template file flatCollectPrimitiveToObjectIterable.stg.
  • Constructor Details

  • Method Details

    • each

      public void each(Procedure<? super V> procedure)
      Description copied from interface: RichIterable
      The procedure is executed for each element in the iterable.

      Example using a Java 8 lambda expression:

       people.each(person -> LOGGER.info(person.getName()));
       

      Example using an anonymous inner class:

       people.each(new Procedure<Person>()
       {
           public void value(Person 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).
      See Also:
    • forEachWithIndex

      public void forEachWithIndex(ObjectIntProcedure<? super V> objectIntProcedure)
      Description copied from interface: InternalIterable
      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());
           }
       });
       
      Specified by:
      forEachWithIndex in interface InternalIterable<V>
      Overrides:
      forEachWithIndex in class AbstractRichIterable<V>
    • forEachWith

      public <P> void forEachWith(Procedure2<? super V,? super P> procedure, P parameter)
      Description copied from interface: InternalIterable
      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);
       
      Specified by:
      forEachWith in interface InternalIterable<V>
      Overrides:
      forEachWith in class AbstractRichIterable<V>
    • iterator

      public Iterator<V> iterator()
    • detect

      public V detect(Predicate<? super V> predicate)
      Description copied from interface: RichIterable
      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"));
       

      Example using an anonymous inner class:

       Person person =
           people.detect(new Predicate<Person>()
           {
               public boolean accept(Person person)
               {
                   return person.getFirstName().equals("John") && person.getLastName().equals("Smith");
               }
           });
       
      Specified by:
      detect in interface RichIterable<V>
      Overrides:
      detect in class AbstractRichIterable<V>
    • detectOptional

      public Optional<V> detectOptional(Predicate<? super V> predicate)
      Description copied from interface: RichIterable
      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"));
       

      Specified by:
      detectOptional in interface RichIterable<V>
      Overrides:
      detectOptional in class AbstractRichIterable<V>
    • anySatisfy

      public boolean anySatisfy(Predicate<? super V> predicate)
      Description copied from interface: RichIterable
      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.
      Specified by:
      anySatisfy in interface RichIterable<V>
      Overrides:
      anySatisfy in class AbstractRichIterable<V>
    • anySatisfyWith

      public <P> boolean anySatisfyWith(Predicate2<? super V,? super P> predicate, P parameter)
      Description copied from interface: RichIterable
      Returns true if the predicate evaluates to true for any element of the collection, or return false. Returns false if the collection is empty.
      Specified by:
      anySatisfyWith in interface RichIterable<V>
      Overrides:
      anySatisfyWith in class AbstractRichIterable<V>
    • allSatisfy

      public boolean allSatisfy(Predicate<? super V> predicate)
      Description copied from interface: RichIterable
      Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty. Otherwise, returns false.
      Specified by:
      allSatisfy in interface RichIterable<V>
      Overrides:
      allSatisfy in class AbstractRichIterable<V>
    • allSatisfyWith

      public <P> boolean allSatisfyWith(Predicate2<? super V,? super P> predicate, P parameter)
      Description copied from interface: RichIterable
      Returns true if the predicate evaluates to true for every element of the collection, or returns false.
      Specified by:
      allSatisfyWith in interface RichIterable<V>
      Overrides:
      allSatisfyWith in class AbstractRichIterable<V>
    • noneSatisfy

      public boolean noneSatisfy(Predicate<? super V> predicate)
      Description copied from interface: RichIterable
      Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty. Otherwise, returns false.
      Specified by:
      noneSatisfy in interface RichIterable<V>
      Overrides:
      noneSatisfy in class AbstractRichIterable<V>
    • noneSatisfyWith

      public <P> boolean noneSatisfyWith(Predicate2<? super V,? super P> predicate, P parameter)
      Description copied from interface: RichIterable
      Returns true if the predicate evaluates to false for every element of the collection, or return false. Returns true if the collection is empty.
      Specified by:
      noneSatisfyWith in interface RichIterable<V>
      Overrides:
      noneSatisfyWith in class AbstractRichIterable<V>