Package org.jboss.weld.util.collections
Class Iterators
java.lang.Object
org.jboss.weld.util.collections.Iterators
Static utility methods for
Iterator.- Author:
- Martin Kouba
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> booleanaddAll(Collection<T> target, Iterator<? extends T> iterator) Add all elements in the iterator to the collection.static <T> Iterator<T>Combine the iterators into a single one.static <T,R> Iterator<R>
-
Method Details
-
addAll
Add all elements in the iterator to the collection.- Parameters:
target-iterator-- Returns:
- true if the target was modified, false otherwise
-
concat
Combine the iterators into a single one.- Parameters:
iterators- An iterator of iterators- Returns:
- a single combined iterator
-
transform
public static <T,R> Iterator<R> transform(Iterator<T> iterator, Function<? super T, ? extends R> function) - Parameters:
iterator-function-- Returns:
- an iterator that applies the given function to each element of the original iterator
-