I would like to convert the following multidimensional array
[[ChestPain, (Chest), Heartburn], [Day2NumberofRefluxes, 2, 1, 5], [SIDay2, 15.4, 3.8, 71.4], [SAPDay2, 70.2, 0.0, 99.9]]
into a HashMap as follows
mapReflDayOneandTwo{Day2NumberofRefluxesChestPain=2, Day2NumberofRefluxes(Chest)=1, Day2NumberofRefluxesHeartburn=5, SIDay2ChestPain=15.4, SIDay2(Chest)=3.8, SIDay2Heartburn=71.4, SAPDay2ChestPain=70.2, SAPDay2(Chest)=0.0, SAPDay2Heartburn=99.9}
I am trying to do this with the following code:
for (int ff=1;ff<Symptoms.size();ff++){
for (int fx=0;fx<Symptoms.get(0).size();fx++){
for (int fxr=1;fxr<Symptoms.get(fx).size();fxr++){
mapReflDayOneandTwo.put(Symptoms.get(ff).get(0)+Symptoms.get(0).get(fx),Symptoms.get(ff).get(fxr));
}
}
}
However when I do this the values seem to be incorrect and I get the following results with the values associated with the wrong keys. What am I doing wrong in the loop? (and shifting the ff to start at 0 or fxr to start at 0 doesn't work either)
mapReflDayOneandTwo{Day2NumberofRefluxesChestPain=1, Day2NumberofRefluxes(Chest)=5, Day2NumberofRefluxesHeartburn=5, SIDay2ChestPain=3.8, SIDay2(Chest)=71.4, SIDay2Heartburn=71.4, SAPDay2ChestPain=0.0, SAPDay2(Chest)=99.9, SAPDay2Heartburn=99.9}