I have a structure
HashMap<String,HashMap<Integer, HashMap<Integer, question>>> lang=new HashMap<String,HashMap<Integer, HashMap<Integer, question>>>();
HashMap<Integer,HashMap<Integer,question>> section= new HashMap<Integer,HashMap<Integer,question>>();
HashMap<Integer,question> questions= new HashMap<Integer,question>();
based on my logic I fill questions, section
while(logic){
for(someother logic){
//make the skeleton structure of the object
questions.add(integer,object);
}
section.add(integer,map3);
}
now I use this map2 as a skeleton and make changes
HashMap<Integer,HashMap<Integer,object>> tempMap= new HashMap<Integer,HashMap<Integer,object>>();
while(logicnew){
while(logic 2){
tempMap = new HashMap(section);
while(logic 3){
tempMap2 = new HashMap(tempMap.get(integer));
//make my changes
}
}
lang.add(integer,tempMap);
}
Multiple languages have multiple sections, multiple sections have multiple questions.
The problem is the values are getting over written i.e. if I have french text in the first language and english text in the second language, I just see english text in both the lang maps I make. Could you please tell what is wrong? Let me know if there is any better way to do it.
Thanks!
I have deep cloned (using object
serializationanddeserialization) the sectionhashmapand stored in the temphashmapand used the temphashmapto add the question text which can now be added according to the language, making my langhashmap.