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); } } } }