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

Method toArray

output/java_guava/1.4.17/Ints.java:492–504  ·  view source on GitHub ↗

Returns an array containing each value of collection, converted to a int value in the manner of Number#intValue. Elements are copied from the argument collection as if by collection.toArray(). Calling this method is as thread-safe as calling that method. @param c

(Collection<? extends Number> collection)

Source from the content-addressed store, hash-verified

490
491
492 public static int[] toArray(Collection<? extends Number> collection) {
493 if (collection instanceof IntArrayAsList) {
494 return ((IntArrayAsList) collection).toIntArray();
495 }
496 Object[] boxedArray = collection.toArray();
497 int len = boxedArray.length;
498 int[] array = new int[len];
499 for (int i = 0; i < len; i++) {
500 // checkNotNull for GWT (do not optimize)
501 array[i] = ((Number) checkNotNull(boxedArray[i])).intValue();
502 }
503 return array;
504 }
505
506 /**
507 * Returns a fixed-size list backed by the specified array, similar to

Callers 15

indexesMethod · 0.95
concatenatingMethod · 0.45
copyOfMethod · 0.45
writeReplaceMethod · 0.45
leastOfMethod · 0.45
writeReplaceMethod · 0.45
copyOfMethod · 0.45
writeReplaceMethod · 0.45
distancesMethod · 0.45
mainMethod · 0.45

Calls 3

toIntArrayMethod · 0.45
intValueMethod · 0.45
checkNotNullMethod · 0.45

Tested by

no test coverage detected