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