MCPcopy Index your code
hub / github.com/antlr/codebuff / toArray

Method toArray

output/java_guava/1.4.18/Iterators.java:363–367  ·  view source on GitHub ↗

Copies an iterator's elements into an array. The iterator will be left exhausted: its hasNext() method will return false. @param iterator the iterator to copy @param type the type of the elements @return a newly-allocated array into which all the elements of the iterator hav

(Iterator<? extends T> iterator, Class<T> type)

Source from the content-addressed store, hash-verified

361 */
362
363 @GwtIncompatible // Array.newInstance(Class, int)
364 public static <T> T[] toArray(Iterator<? extends T> iterator, Class<T> type) {
365 List<T> list = Lists.newArrayList(iterator);
366 return Iterables.toArray(list, type);
367 }
368
369 /**
370 * Adds all elements in {@code iterator} to {@code collection}. The iterator

Callers

nothing calls this directly

Calls 2

newArrayListMethod · 0.95
toArrayMethod · 0.95

Tested by

no test coverage detected