Here you can find the source of toArray(Double[] array)
public static double[] toArray(Double[] array)
//package com.java2s; /*L//from w w w . j a v a 2 s . c o m * Copyright Oracle Inc, SAIC-F. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/cadsr-bulk-loader/LICENSE.txt for details. */ public class Main { public static double[] toArray(Double[] array) { if (array == null) { return null; } double[] data = new double[array.length]; for (int i = 0; i < array.length; i++) { double val = (array[i] == null) ? 0 : array[i].intValue(); data[i] = val; } return data; } public static int[] toArray(Integer[] array) { if (array == null) { return null; } int[] data = new int[array.length]; for (int i = 0; i < array.length; i++) { int val = (array[i] == null) ? 0 : array[i].intValue(); data[i] = val; } return data; } }