java hashmap array to double array
- by Tweety
Hi,
I declared LinkedHashMap<String, float[]> and now I want to convert float[] values into double[][]. I am using following code.
LinkedHashMap<String, float[]> fData;
double data[][] = null;
Iterator<String> iter = fData.keySet().iterator();
int i = 0;
while (iter.hasNext()) {
faName = iter.next();
tValue = fData.get(faName);
//data = new double[fData.size()][tValue.length];
for (int j = 0; j < tValue.length; j++) {
data[i][j] = tValue[j];
}
i++;
}
When I try to print data System.out.println(Arrays.deepToString(data)); it doesn't show the data :(
I tried to debug my code and i figured out that I have to initialize data outside the
while loop but then I don't know the array dimensions :(
How to solve it?
Thanks