protected void check(List<?> eList, List<?> cList) { if (eList.isEmpty()) { surplus.addAll(cList); return; } if (cList.isEmpty()) { missing.addAll(eList); return; } Parse row = (Parse) eList.remove(0); Parse cell = row.parts; Object obj = cList.remove(0); for (int i = 0; i < columnBindings.length && cell != null; i++) { TypeAdapter a = columnBindings[i].adapter; if (a != null) { a.target = obj; } check(cell, a); cell = cell.more; } check(eList, cList); }
protected void check (List<Parse> eList, List<Parse> cList) { if (eList.size()==0) { surplus.addAll(cList); return; } if (cList.size()==0) { missing.addAll(eList); return; } Parse row = eList.remove(0); Parse cell = row.parts; Object obj = cList.remove(0); for (int i=0; i<columnBindings.length && cell!=null; i++) { TypeAdapter a = columnBindings[i]; if (a != null) { a.target = obj; } check(cell, a); cell = cell.more; } check (eList, cList); }
protected void check(List<?> eList, List<?> cList) { if (eList.isEmpty()) { surplus.addAll(cList); return; } if (cList.isEmpty()) { missing.addAll(eList); return; } Parse row = (Parse) eList.remove(0); Parse cell = row.parts; Object obj = cList.remove(0); for (int i = 0; i < columnBindings.length && cell != null; i++) { TypeAdapter a = columnBindings[i].adapter; if (a != null) { a.target = obj; } check(cell, a); cell = cell.more; } check(eList, cList); }
protected void match(List expected, List computed, int col) { if (col >= columnBindings.length) { check (expected, computed); } else if (columnBindings[col] == null) { match (expected, computed, col+1); } else { Map eMap = eSort(expected, col); Map cMap = cSort(computed, col); Set keys = union(eMap.keySet(),cMap.keySet()); for (Iterator i=keys.iterator(); i.hasNext(); ) { Object key = i.next(); List eList = (List)eMap.get(key); List cList = (List)cMap.get(key); if (eList == null) { surplus.addAll(cList); } else if (cList == null) { missing.addAll(eList); } else if (eList.size()==1 && cList.size()==1) { check(eList, cList); } else { match(eList, cList, col+1); } } } }
protected void match(List<?> expected, List<?> computed, int col) { if (col >= columnBindings.length) { check(expected, computed); } else if (columnBindings[col] == null) { match(expected, computed, col + 1); } else { Map<Object, Object> eMap = eSort(expected, col); Map<Object, Object> cMap = cSort(computed, col); Set<Object> keys = union(eMap.keySet(), cMap.keySet()); for (Object key : keys) { List<?> eList = (List<?>) eMap.get(key); List<?> cList = (List<?>) cMap.get(key); if (eList == null) { surplus.addAll(cList); } else if (cList == null) { missing.addAll(eList); } else if (eList.size() == 1 && cList.size() == 1) { check(eList, cList); } else { match(eList, cList, col + 1); } } } }
protected void match(List<?> expected, List<?> computed, int col) { if (col >= columnBindings.length) { check(expected, computed); } else if (columnBindings[col] == null) { match(expected, computed, col + 1); } else { Map<Object, Object> eMap = eSort(expected, col); Map<Object, Object> cMap = cSort(computed, col); Set<Object> keys = union(eMap.keySet(), cMap.keySet()); for (Object key : keys) { List<?> eList = (List<?>) eMap.get(key); List<?> cList = (List<?>) cMap.get(key); if (eList == null) { surplus.addAll(cList); } else if (cList == null) { missing.addAll(eList); } else if (eList.size() == 1 && cList.size() == 1) { check(eList, cList); } else { match(eList, cList, col + 1); } } } }