I have a function that is capable to read data from multiple files with the following structure:
id date temp psal
1 2016/02/01 37.6 35.9
2 2016/02/02 30.3 35.7
3 2016/02/03 28.2 36.8
4 2016/02/04 27.7 37.7
5 2016/02/05 28.7 37.9
6 2016/02/06 28.7 37.9
The function is:
ArrayList<Hashtable<String, ArrayList<String>>> processedFilesArray = ReadFiles(files);
If I try to retrieve the data by using for example:
System.out.println(processedFilesArray.get(0));
Then I get the following response:
{Psals=[35.9, 35.7, 36.8, 37.7, 37.9, 37.9], Temps=[37.6, 30.3, 28.2, 27.7, 28.7, 28.7], ids=[1, 2, 3, 4, 5, 6], DateStrings=[2016/02/01, 2016/02/02, 2016/02/03, 2016/02/04, 2016/02/05, 2016/02/06]}
My question is: How can I obtain the different values of the keys (Temps, Psals, ids, etc) by sepparate to plot them using jfreechart?
Thanks in advance
ArrayList<Hashtable<String, ArrayList<String>>>yourself? If so, it's the wrong data structure (effectively a "parallel arrays" structure). You should define a class to hold one line of input as an object.