Here you can find the source of listToArray(final List extends Number> list)
Parameter | Description |
---|---|
list | the list |
public static double[] listToArray(final List<? extends Number> list)
//package com.java2s; /*/*from w ww . j a v a 2 s .c o m*/ * Title: CloudSim Toolkit * Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds * Licence: GPL - http://www.gnu.org/copyleft/gpl.html * * Copyright (c) 2009-2012, The University of Melbourne, Australia */ import java.util.List; public class Main { /** * List to array. * * @param list the list * @return the double[] */ public static double[] listToArray(final List<? extends Number> list) { double[] array = new double[list.size()]; for (int i = 0; i < array.length; i++) { array[i] = list.get(i).doubleValue(); } return array; } }