Returns a view containing the result of applying function to each element of fromIterator. The returned iterator supports remove() if fromIterator does. After a successful remove() call, fromIterator no longer contains the corresponding element.
(
final Iterator<F> fromIterator, final Function<? super F, ? extends T> function)
| 745 | * longer contains the corresponding element. |
| 746 | */ |
| 747 | public static <F, T> Iterator<T> transform( |
| 748 | final Iterator<F> fromIterator, final Function<? super F, ? extends T> function) { |
| 749 | checkNotNull(function); |
| 750 | return new TransformedIterator<F, T>(fromIterator) { |
| 751 | @Override |
| 752 | T transform(F from) { |
| 753 | return function.apply(from); |
| 754 | } |
| 755 | }; |
| 756 | } |
| 757 | |
| 758 | /** |
| 759 | * Advances {@code iterator} {@code position + 1} times, returning the |
no test coverage detected