java.lang.Iterable<T>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>, 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>AbstractArrayAdapter, AbstractBag, AbstractBiMap, AbstractCollectionAdapter, AbstractHashBag, AbstractImmutableBag, AbstractImmutableBagIterable, AbstractImmutableBiMap, AbstractImmutableByteObjectMap, AbstractImmutableCharObjectMap, AbstractImmutableCollection, AbstractImmutableDoubleObjectMap, AbstractImmutableFloatObjectMap, AbstractImmutableIntObjectMap, AbstractImmutableLongObjectMap, AbstractImmutableMap, AbstractImmutableSet, AbstractImmutableShortObjectMap, AbstractImmutableSortedMap, AbstractLazyIterable, AbstractListAdapter, AbstractMapIterable, AbstractMemoryEfficientMutableList, AbstractMultiReaderMutableCollection, AbstractMutableBag, AbstractMutableBagIterable, AbstractMutableCollection, AbstractMutableList, AbstractMutableMap, AbstractMutableMapIterable, AbstractMutableSet, AbstractMutableSortedBag, AbstractMutableSortedMap, AbstractRichIterable, AbstractSynchronizedMapIterable, AbstractSynchronizedMutableCollection, AbstractSynchronizedRichIterable, AbstractUnifiedSet, AbstractUnmodifiableMutableCollection, ArrayAdapter, ArrayListAdapter, ArrayStack, ByteObjectHashMap, CharObjectHashMap, ChunkIterable, 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, ImmutableTreeMap, ImmutableUnifiedMap, ImmutableUnifiedMapWithHashingStrategy, Interval, IntObjectHashMap, LazyIterableAdapter, ListAdapter, LongObjectHashMap, MapAdapter, MultiReaderFastList, MultiReaderHashBag, MultiReaderUnifiedSet, 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, UnmodifiableMutableSet, UnmodifiableRichIterable, UnmodifiableShortObjectMap, UnmodifiableSortedBag, UnmodifiableSortedSet, UnmodifiableStack, UnmodifiableTreeMap, ZipIterable, ZipWithIndexIterablepublic interface InternalIterable<T>
extends java.lang.Iterable<T>
| Modifier and Type | Method | Description |
|---|---|---|
default void |
forEach(java.util.function.Consumer<? super T> consumer) |
|
void |
forEach(Procedure<? super T> procedure) |
The procedure is executed for each element in the iterable.
|
<P> void |
forEachWith(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.
|
void |
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) |
Deprecated.
in 6.0. Use
OrderedIterable.forEachWithIndex(ObjectIntProcedure) instead. |
void forEach(Procedure<? super T> procedure)
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 with Iterable.forEach(java.util.function.Consumer)
since Java 1.8. It is recommended to use RichIterable.each(Procedure) instead to avoid casting to Procedure.RichIterable.each(Procedure),
Iterable.forEach(java.util.function.Consumer)default void forEach(java.util.function.Consumer<? super T> consumer)
forEach in interface java.lang.Iterable<T>@Deprecated void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
OrderedIterable.forEachWithIndex(ObjectIntProcedure) instead.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());
}
});
<P> void forEachWith(Procedure2<? super T,? super P> procedure, P parameter)
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);
Copyright © 2004–2017. All rights reserved.