Class LazyIterableAggregator<E>
java.lang.Object
com.polarion.alm.shared.api.utils.collections.LazyIterableAggregator<E>
- All Implemented Interfaces:
IterableWithSize<E>,Iterable<E>
Aggregates multiple instances of
IterableWithSize to single instance and
does not iterate over the elements in them until it is needed.- Since:
- 3.9.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllTo(Collection<? super E> collection) booleanisEmpty()iterator()intsize()E[]Iterating over array is faster, when checking for concurrent modification is not needed.Returns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Method Details
-
iterator
-
size
public int size()- Specified by:
sizein interfaceIterableWithSize<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIterableWithSize<E>
-
addAllTo
- Specified by:
addAllToin interfaceIterableWithSize<E>
-
toArrayList
Description copied from interface:IterableWithSizeReturns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.- Specified by:
toArrayListin interfaceIterableWithSize<E>
-
toArray
Description copied from interface:IterableWithSizeIterating over array is faster, when checking for concurrent modification is not needed.- Specified by:
toArrayin interfaceIterableWithSize<E>- Parameters:
a- - must have exactly the same size as the collection
-