MCPcopy Create free account
hub / github.com/antlr/codebuff / transform

Method transform

corpus/java/training/guava/collect/Iterators.java:747–756  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 9

keyIteratorMethod · 0.95
valueIteratorMethod · 0.95
entryIteratorMethod · 0.95
iteratorMethod · 0.95
iteratorMethod · 0.95
entryIteratorMethod · 0.95
cellIteratorMethod · 0.95
cellIteratorMethod · 0.95
transformEntriesMethod · 0.95

Calls 2

applyMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected