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)
| 789 | |
| 790 | |
| 791 | public static <F, T> Iterator<T> transform(final Iterator<F> fromIterator, final Function<? super F, ? extends T> function) { |
| 792 | checkNotNull(function); |
| 793 | return new TransformedIterator<F, T>(fromIterator) { |
| 794 | @Override |
| 795 | T transform(F from) { |
| 796 | return function.apply(from); |
| 797 | } |
| 798 | }; |
| 799 | } |
| 800 | |
| 801 | /** |
| 802 | * Advances {@code iterator} {@code position + 1} times, returning the |
no test coverage detected