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

Method copyInto

output/java_guava/1.4.18/FluentIterable.java:820–831  ·  view source on GitHub ↗

Copies all the elements from this fluent iterable to collection. This is equivalent to calling Iterables.addAll(collection, this). Stream equivalent: stream.forEachOrdered(collection::add) or stream.forEach(collection::add). @param collection the c

(C collection)

Source from the content-addressed store, hash-verified

818 */
819
820 @CanIgnoreReturnValue
821 public final <C extends Collection<? super E>> C copyInto(C collection) {
822 checkNotNull(collection);
823 if (iterable instanceof Collection) {
824 collection.addAll(Collections2.cast(iterable));
825 } else {
826 for (E item : iterable) {
827 collection.add(item);
828 }
829 }
830 return collection;
831 }
832
833 /**
834 * Returns a {@link String} containing all of the elements of this fluent iterable joined with

Callers

nothing calls this directly

Calls 4

castMethod · 0.95
addAllMethod · 0.65
addMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected