As you already have noticed you can't cast to and fro primitives and Objects of
any kind. If you have a List or Vector or array of Objects and you want to cast
them to a primitive type all those Objects have to be a wrapper class of a (numerical)
primitive type (Double, Long, Integer or whatever).
This is how you cast a List of Objects to an array of doubles:
-
public double[] toArray(List<Object> list) {
-
double[] array= new array(list.size());
-
for (int i= 0; i < array.length; i++)
-
array[i]= ((Double)list.get(i)).doubleValue();
-
return array;
-
}
-
kind regards,
Jos