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

Method toArray

output/java_guava/1.4.17/Longs.java:576–588  ·  view source on GitHub ↗

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

(Collection<? extends Number> collection)

Source from the content-addressed store, hash-verified

574
575
576 public static long[] toArray(Collection<? extends Number> collection) {
577 if (collection instanceof LongArrayAsList) {
578 return ((LongArrayAsList) collection).toLongArray();
579 }
580 Object[] boxedArray = collection.toArray();
581 int len = boxedArray.length;
582 long[] array = new long[len];
583 for (int i = 0; i < len; i++) {
584 // checkNotNull for GWT (do not optimize)
585 array[i] = ((Number) checkNotNull(boxedArray[i])).longValue();
586 }
587 return array;
588 }
589
590 /**
591 * Returns a fixed-size list backed by the specified array, similar to

Callers

nothing calls this directly

Calls 3

toLongArrayMethod · 0.45
longValueMethod · 0.45
checkNotNullMethod · 0.45

Tested by

no test coverage detected