1
我正在尝试以下内容来更新HashMap
以及学生的新值,请检查我错过了什么地方。访问相同ArrayList的HashMap
ArrayList<Student> tempStudentList = XMLParser.studentHashMap.get(currentSectionName);
if(studentList==null)
{
Log.v(CURRENT_SCREEN,"created another student list for section name:"+currentSectionName);
tempStudentList = new ArrayList<Student>();
}
Log.v(CURRENT_SCREEN,"Added student to the list");
tempStudentList.add(currentStudent);
XMLParser.studentHashMap.put(currentSectionName, tempStudentList);
什么问题,你所看到的:此外,Java集合是可变的,在studentHashMap阵列直接,所以你不需要你的地图上的每个查询后执行另一个放操纵? – seanhodges 2011-06-13 12:37:15
您没有给我们足够的上下文 - 例如,我们不知道发生了什么问题,或者“学生”来自哪里。 – 2011-06-13 12:38:01