私は構造を持っています
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>();
私の論理に基づいて、質問、セクションに記入します
while(logic){
for(someother logic){
//make the skeleton structure of the object
questions.add(integer,object);
}
section.add(integer,map3);
}
今、この map2 をスケルトンとして使用し、変更を加えます
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);
}
複数の言語には複数のセクションがあり、複数のセクションには複数の質問があります。問題は、値が上書きされていることです。つまり、第一言語にフランス語のテキストがあり、第二言語に英語のテキストがある場合、作成した両方の言語マップに英語のテキストが表示されます。何が悪いのか教えてください。それを行うためのより良い方法があれば教えてください。
ありがとう!