Here you can find the source of toArray(List
Parameter | Description |
---|---|
list | List of doubles |
private static double[] toArray(List<Double> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**//from ww w . ja v a2 s. c o m * Method for turning a list of doubles to an array. * * @param list List of doubles * @return Array of doubles. */ private static double[] toArray(List<Double> list) { double[] values = new double[list.size()]; for (int i = 0; i < values.length; i++) { values[i] = list.get(i); } return values; } }