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 TypeMethodDescriptionvoid
addAllTo
(Collection<? super T> collection) boolean
isEmpty()
iterator()
int
size()
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, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
IterableWithSizeCollectionAdapter
-
-
Method Details
-
iterator
-
size
public int size()- Specified by:
size
in interfaceIterableWithSize<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceIterableWithSize<T>
-
addAllTo
- Specified by:
addAllTo
in interfaceIterableWithSize<T>
-
toArrayList
Description copied from interface:IterableWithSize
Returns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.- Specified by:
toArrayList
in interfaceIterableWithSize<T>
-
toArray
Description copied from interface:IterableWithSize
Iterating over array is faster, when checking for concurrent modification is not needed.- Specified by:
toArray
in interfaceIterableWithSize<T>
- Parameters:
a
- - must have exactly the same size as the collection
-