if(equipmentList.size()!=0){
String [] equipIdArray =new String[3];
for (int i = 0; i < equipmentList.size(); i++) {
Element equipment = (Element)equipmentList.get(i);
String equipCode = equipment.elementText("type_code");
System.out.println("equipCode :"+equipCode);
/*
* 用于储存设备信息的数组
* equipInfoArray [0]存的是type_id T002
* equipInfoArray [1]存的是building_id
* equipInfoArray [2]存的是equip_id
*/
equipIdArray[0] = equipment.elementText("type_id");
equipIdArray[1] = equipment.elementText("building_id");
equipIdArray[2] = equipment.attributeValue("equip_id");
System.out.println("equip_id :"+equipIdArray[2]);
equipInfoHashMap.put(equipCode,equipIdArray);
equipIdArray[0] = null;
equipIdArray[1] = null;
equipIdArray[2] = null;
}
}
System.out.println("equip_id :"+equipIdArray[2]);这句输出的数据都没有问题,很正常,可是为什么放进hashmap里面的全都是null的???