1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

add toPrimitiveArray(Collection)

This commit is contained in:
oblonski 2015-02-23 22:12:28 +01:00
parent 323dbbfa87
commit 67b67b8c45

View file

@ -16,6 +16,7 @@
******************************************************************************/
package jsprit.core.util;
import java.util.Collection;
import java.util.List;
public class ArrayUtils {
@ -26,4 +27,14 @@ public class ArrayUtils {
return arr;
}
public static double[] toPrimitiveArray(Collection<Double> collection){
double[] arr = new double[collection.size()];
int i=0;
for(Double d : collection){
arr[i]=d;
i++;
}
return arr;
}
}