Interface InternalIterable<T>
- All Superinterfaces:
Iterable<T>
- All Known Subinterfaces:
Bag<T>, BiMap<K,V>, ByteObjectMap<V>, CharObjectMap<V>, ConcurrentMutableMap<K, V>, DoubleObjectMap<V>, FixedSizeCollection<T>, FixedSizeList<T>, FixedSizeMap<K, V>, FixedSizeSet<T>, FloatObjectMap<V>, ImmutableBag<T>, ImmutableBagIterable<T>, ImmutableBiMap<K, V>, ImmutableByteObjectMap<V>, ImmutableCharObjectMap<V>, ImmutableCollection<T>, ImmutableDoubleObjectMap<V>, ImmutableFloatObjectMap<V>, ImmutableIntObjectMap<V>, ImmutableList<T>, ImmutableLongObjectMap<V>, ImmutableMap<K, V>, ImmutableMapIterable<K, V>, ImmutableOrderedMap<K, V>, ImmutablePrimitiveObjectMap<V>, ImmutableSet<T>, ImmutableSetIterable<T>, ImmutableShortObjectMap<V>, ImmutableSortedBag<T>, ImmutableSortedMap<K, V>, ImmutableSortedSet<T>, ImmutableStack<T>, IntObjectMap<V>, LazyIterable<T>, ListIterable<T>, LongObjectMap<V>, MapIterable<K, V>, MultiReaderBag<T>, MultiReaderList<T>, MultiReaderSet<T>, MutableBag<T>, MutableBagIterable<T>, MutableBiMap<K, V>, MutableByteObjectMap<V>, MutableCharObjectMap<V>, MutableCollection<T>, MutableDoubleObjectMap<V>, MutableFloatObjectMap<V>, MutableIntObjectMap<V>, MutableList<T>, MutableLongObjectMap<V>, MutableMap<K, V>, MutableMapIterable<K, V>, MutableOrderedMap<K, V>, MutablePrimitiveObjectMap<V>, MutableSet<T>, MutableSetIterable<T>, MutableShortObjectMap<V>, MutableSortedBag<T>, MutableSortedMap<K, V>, MutableSortedSet<T>, MutableStack<T>, OrderedIterable<T>, OrderedMap<K, V>, PrimitiveObjectMap<V>, ReversibleIterable<T>, RichIterable<T>, SetIterable<T>, ShortObjectMap<V>, SortedBag<T>, SortedIterable<T>, SortedMapIterable<K, V>, SortedSetIterable<T>, StackIterable<T>, UnsortedBag<T>, UnsortedMapIterable<K, V>, UnsortedSetIterable<T>
- All Known Implementing Classes:
AbstractArrayAdapter, AbstractBag, AbstractBiMap, AbstractCollectionAdapter, AbstractHashBag, AbstractImmutableBag, AbstractImmutableBagIterable, AbstractImmutableBiMap, AbstractImmutableByteObjectMap, AbstractImmutableCharObjectMap, AbstractImmutableCollection, AbstractImmutableDoubleObjectMap, AbstractImmutableFloatObjectMap, AbstractImmutableIntObjectMap, AbstractImmutableLongObjectMap, AbstractImmutableMap, AbstractImmutableSet, AbstractImmutableShortObjectMap, AbstractImmutableSortedMap, AbstractLazyIterable, AbstractListAdapter, AbstractMapIterable, AbstractMemoryEfficientMutableList, AbstractMultiReaderMutableCollection, AbstractMultiReaderMutableCollection.UntouchableMutableCollection, AbstractMutableBag, AbstractMutableBagIterable, AbstractMutableCollection, AbstractMutableList, AbstractMutableList.SubList, AbstractMutableMap, AbstractMutableMapIterable, AbstractMutableSet, AbstractMutableSortedBag, AbstractMutableSortedMap, AbstractRichIterable, AbstractSynchronizedMapIterable, AbstractSynchronizedMutableCollection, AbstractSynchronizedRichIterable, AbstractUnifiedSet, AbstractUnmodifiableMutableCollection, ArrayAdapter, ArrayListAdapter, ArrayStack, BoxedMutableBooleanList, BoxedMutableBooleanSet, BoxedMutableByteList, BoxedMutableByteSet, BoxedMutableCharList, BoxedMutableCharSet, BoxedMutableDoubleList, BoxedMutableDoubleSet, BoxedMutableFloatList, BoxedMutableFloatSet, BoxedMutableIntList, BoxedMutableIntSet, BoxedMutableLongList, BoxedMutableLongSet, BoxedMutableShortList, BoxedMutableShortSet, ByteObjectHashMap, CharObjectHashMap, ChunkBooleanIterable, ChunkByteIterable, ChunkCharIterable, ChunkDoubleIterable, ChunkFloatIterable, ChunkIntIterable, ChunkIterable, ChunkLongIterable, ChunkShortIterable, CollectBooleanToObjectIterable, CollectByteToObjectIterable, CollectCharToObjectIterable, CollectDoubleToObjectIterable, CollectFloatToObjectIterable, CollectIntToObjectIterable, CollectionAdapter, CollectIterable, CollectLongToObjectIterable, CollectShortToObjectIterable, CompositeFastList, CompositeIterable, ConcurrentHashMap, ConcurrentHashMapUnsafe, ConcurrentMutableHashMap, DistinctIterable, DoubleObjectHashMap, DropIterable, DropWhileIterable, FastList, FlatCollectBooleanToObjectIterable, FlatCollectByteToObjectIterable, FlatCollectCharToObjectIterable, FlatCollectDoubleToObjectIterable, FlatCollectFloatToObjectIterable, FlatCollectIntToObjectIterable, FlatCollectIterable, FlatCollectLongToObjectIterable, FlatCollectShortToObjectIterable, FloatObjectHashMap, HashBag, HashBagWithHashingStrategy, HashBiMap, ImmutableArrayBag, ImmutableHashBag, ImmutableOrderedMapAdapter, ImmutableTreeMap, ImmutableUnifiedMap, ImmutableUnifiedMapWithHashingStrategy, Interval, IntObjectHashMap, LazyIterableAdapter, ListAdapter, LongObjectHashMap, MapAdapter, MultiReaderFastList, MultiReaderHashBag, MultiReaderUnifiedSet, OrderedMapAdapter, RandomAccessListAdapter, RejectIterable, ReverseIterable, SelectInstancesOfIterable, SelectIterable, SetAdapter, ShortObjectHashMap, SortedMapAdapter, SortedSetAdapter, SynchronizedBag, SynchronizedBiMap, SynchronizedByteObjectMap, SynchronizedCharObjectMap, SynchronizedDoubleObjectMap, SynchronizedFloatObjectMap, SynchronizedIntObjectMap, SynchronizedLongObjectMap, SynchronizedMutableCollection, SynchronizedMutableList, SynchronizedMutableMap, SynchronizedMutableSet, SynchronizedRichIterable, SynchronizedShortObjectMap, SynchronizedSortedBag, SynchronizedSortedMap, SynchronizedSortedSet, SynchronizedStack, TakeIterable, TakeWhileIterable, TapIterable, TreeBag, TreeSortedMap, TreeSortedSet, UnifiedMap, UnifiedMapWithHashingStrategy, UnifiedSet, UnifiedSetWithHashingStrategy, UnmodifiableBag, UnmodifiableBiMap, UnmodifiableByteObjectMap, UnmodifiableCharObjectMap, UnmodifiableDoubleObjectMap, UnmodifiableFloatObjectMap, UnmodifiableIntObjectMap, UnmodifiableLongObjectMap, UnmodifiableMutableCollection, UnmodifiableMutableList, UnmodifiableMutableMap, UnmodifiableMutableOrderedMap, UnmodifiableMutableSet, UnmodifiableRichIterable, UnmodifiableShortObjectMap, UnmodifiableSortedBag, UnmodifiableSortedSet, UnmodifiableStack, UnmodifiableTreeMap, ZipIterable, ZipWithIndexIterable
The base interface for all Eclipse Collections. All Eclipse Collections are internally iterable, and this interface provides
the base set of internal iterators that every Eclipse collection should implement.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidvoidThe procedure is executed for each element in the iterable.<P> voidforEachWith(Procedure2<? super T, ? super P> procedure, P parameter) The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.voidforEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) Deprecated.in 6.0.Methods inherited from interface Iterable
iterator, spliterator
-
Method Details
-
forEach
The procedure is executed for each element in the iterable.Example using a Java 8 lambda:
people.forEach(Procedures.cast(person -> LOGGER.info(person.getName())));
Example using an anonymous inner class:
people.forEach(new Procedure<Person>() { public void value(Person person) { LOGGER.info(person.getName()); } });NOTE: This method started to conflict withIterable.forEach(java.util.function.Consumer)since Java 1.8. It is recommended to useRichIterable.each(Procedure)instead to avoid casting to Procedure.- See Also:
-
forEach
-
forEachWithIndex
Deprecated.in 6.0. UseOrderedIterable.forEachWithIndex(ObjectIntProcedure)instead.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()); } }); -
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);
-