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

Method toArray

output/java_guava/1.4.17/Floats.java:419–431  ·  view source on GitHub ↗

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

(Collection<? extends Number> collection)

Source from the content-addressed store, hash-verified

417
418
419 public static float[] toArray(Collection<? extends Number> collection) {
420 if (collection instanceof FloatArrayAsList) {
421 return ((FloatArrayAsList) collection).toFloatArray();
422 }
423 Object[] boxedArray = collection.toArray();
424 int len = boxedArray.length;
425 float[] array = new float[len];
426 for (int i = 0; i < len; i++) {
427 // checkNotNull for GWT (do not optimize)
428 array[i] = ((Number) checkNotNull(boxedArray[i])).floatValue();
429 }
430 return array;
431 }
432
433 /**
434 * Returns a fixed-size list backed by the specified array, similar to

Callers

nothing calls this directly

Calls 3

toFloatArrayMethod · 0.45
floatValueMethod · 0.45
checkNotNullMethod · 0.45

Tested by

no test coverage detected