Package org.wildfly.common.iteration
Class CompositeIterable<T>
- java.lang.Object
-
- org.wildfly.common.iteration.CompositeIterable<T>
-
- All Implemented Interfaces:
Iterable<T>
public class CompositeIterable<T> extends Object implements Iterable<T>
Used for iterating over an series of iterables, thus avoiding the need to allocate/populate a new list containing all elements. More efficient than the alternative when the number of iterables is arbitrary and small relative to the size of each iterable.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description CompositeIterable(Iterable<? extends T>... iterables)Constructs a new composite iterable.CompositeIterable(List<? extends Iterable<? extends T>> iterables)Constructs a new composite iterable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object object)inthashCode()Iterator<T>iterator()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
CompositeIterable
@SafeVarargs public CompositeIterable(Iterable<? extends T>... iterables)
Constructs a new composite iterable.- Parameters:
iterables- a series of iterables
-
-