public static int countnumapp(List mapList) { int numappt = 0; if (mapList == null || mapList.size() == 0) { return numappt; } HashMap apptMap = new HashMap(); HashSet listSet = parititionListByEntry(mapList); Iterator setIt = listSet.iterator(); while (setIt.hasNext()) { List segmentList = (List) setIt.next(); segmentList = StringParser.removeMapHead(segmentList); // String keyString=(String)segmentList.get(0); // int key=Integer.parseInt(keyString); // List apptList=segmentList.subList(1, segmentList.size()); // Appt value= parseToApptFromList(apptList); // apptMap.put(key, value); numappt++; } return numappt; }
public static HashMap parseToApptHashMapFromList(List mapList) { if (mapList == null || mapList.size() == 0) { return null; } HashMap apptMap = new HashMap(); HashSet listSet = parititionListByEntry(mapList); Iterator setIt = listSet.iterator(); int key = 0; while (setIt.hasNext()) { List segmentList = (List) setIt.next(); segmentList = StringParser.removeMapHead(segmentList); //////// Louis change here //////////// // String keyString=(String)segmentList.get(0); // int key=Integer.parseInt(keyString); key++; List apptList = segmentList.subList(1, segmentList.size()); Appt value = parseToApptFromList(apptList); value.setID(key); if (value.gettype() == 4) { // System.out.println("i am here haha"); // String ppljoint = value.getattended(); String[] ppljoint = ((JointAppt) value).getattended(); // System.out.println(ppljoint); for (int i = 0; i < ppljoint.length; i++) { // System.out.println(ppljoint[i] + " "); } apptMap.put(key, value); } else if (value.gettype() == 5) { apptMap.put(key, value); } else if (value.gettype() == 3) { apptMap.put(key, value); // System.out.println("testnum"); } ///////// louis changed end ///////////////////// } return apptMap; }