Class IterableWithSizeCollectionAdapter<T>
java.lang.Object
com.polarion.alm.shared.api.utils.collections.IterableWithSizeCollectionAdapter<T>
- All Implemented Interfaces:
IterableWithSize<T>,Iterable<T>
Adapter from
Collection to IterableWithSize- Since:
- 3.19.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllTo(Collection<? super T> collection) booleanisEmpty()iterator()intsize()T[]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
-
IterableWithSizeCollectionAdapter
-
-
Method Details
-
iterator
-
size
public int size()- Specified by:
sizein interfaceIterableWithSize<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIterableWithSize<T>
-
addAllTo
- Specified by:
addAllToin interfaceIterableWithSize<T>
-
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<T>
-
toArray
Description copied from interface:IterableWithSizeIterating over array is faster, when checking for concurrent modification is not needed.- Specified by:
toArrayin interfaceIterableWithSize<T>- Parameters:
a- - must have exactly the same size as the collection
-