Here you can find the source of copyFromList(final List list, final double[][] data, final int cols)
public static Callable copyFromList(final List list, final double[][] data, final int cols)
//package com.java2s; import java.util.concurrent.*; import java.util.List; public class Main { public static Callable copyFromList(final List list, final double[][] data, final int cols) { Callable c = new Callable() { public Object call() throws Exception { int s = list.size(); double[] rowData = null; int row = -1; int col = 0; for (int i = 0; i < s; i++) { if (i % cols == 0) { row++;//from w w w.j av a2s . c o m rowData = new double[cols]; col = 0; data[row] = rowData; } Object o = list.get(i); rowData[col] = (Double) o; col++; } return data; } }; return c; } }