Here you can find the source of toFloatArray(List
Parameter | Description |
---|---|
list | The list to convert |
public static float[] toFloatArray(List<Float> list)
//package com.java2s; import java.util.List; public class Main { /**/*from w w w . j a v a 2 s . c o m*/ * This converts a list to it's primitive state. * In this case, it converts a {@link Float} list to a * float array. * * @param list The list to convert * @return The primitive array instance of the list's contents. */ public static float[] toFloatArray(List<Float> list) { float[] array = new float[list.size()]; for (int i = 0; i < list.size(); i++) { array[i] = list.get(i); } return array; } /** * * @param arr * @return */ public static float[] toFloatArray(float... arr) { return arr; } }