Here you can find the source of toArrayDouble(final int[] array)
Parameter | Description |
---|---|
array | Array to convert |
public static double[] toArrayDouble(final int[] array)
//package com.java2s; /*/*from w w w . java 2s. com*/ * Nividic development code * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. If you do not have a copy, * see: * * http://www.gnu.org/copyleft/lesser.html * * Copyright for this code is held jointly by the microarray platform * of the ?cole Normale Sup?rieure and the individual authors. * These should be listed in @author doc comments. * * For more information on the Nividic project and its aims, * or to join the Nividic mailing list, visit the home page * at: * * http://www.transcriptome.ens.fr/nividic * */ public class Main { /** * Convert an array of int to an array of double * @param array Array to convert * @return a new array of double */ public static double[] toArrayDouble(final int[] array) { if (array == null) return null; final double[] result = new double[array.length]; for (int i = 0; i < result.length; i++) result[i] = array[i]; return result; } /** * Convert an array of int to an array of double * @param array Array to convert * @return a new array of double */ public static double[] toArrayDouble(final String[] array) { if (array == null) return null; final double[] result = new double[array.length]; for (int i = 0; i < result.length; i++) if (array[i] != null) result[i] = Double.parseDouble(array[i]); return result; } }