List of utility methods to do List Difference
boolean | differentCategory(String prop1, String prop2, List checks if one property belongs to some category and the other to different category return !(cat1 == null || cat2 == null || cat1.isEmpty() || cat2.isEmpty())
&& ((cat1.contains(prop1) && cat2.contains(prop2))
|| (cat1.contains(prop2) && cat2.contains(prop1)));
|
List | diffFloats(List diff Floats List<Double> diffs = new ArrayList<>(); for (int i = 0; i < a.size(); i++) { diffs.add((double) a.get(i) - b.get(i)); return diffs; |
List | diffList(List Returns a list of String objects that appear aList but don't appear in bList. List<String> result = new ArrayList<String>(); for (String a : aList) { if (bList.contains(a) == false) { result.add(a); return result; |
List | diffSet(List i a - b List<T> c = new ArrayList<T>(); Map<T, T> map = new HashMap<T, T>(); for (T t : b) { map.put(t, t); for (T t : a) { if (map.get(t) == null) c.add(t); ... |
void | diffSimple(String name, Object expected, Object actual, List diff Simple boolean changed = true; if (expected == null) { if (actual == null) changed = false; } else { if (expected.equals(actual)) changed = false; if (changed) { messages.add("C " + name + ": " + expected + " ==> " + actual); |
void | extractDifference(List l1, List l2, List in1not2, List in2not1, List inBothFrom1, List inBothFrom2, Comparator c) extract Difference int index1 = 0; int index2 = 0; Object o1 = null; Object o2 = null; String curr1 = null; String curr2 = null; String next1 = null; String next2 = null; ... |
List | formatDifferentFileNames(List format Different File Names List<String> ret = new ArrayList<String>(); List<String> l1 = new ArrayList<String>(); List<String> l2 = new ArrayList<String>(); for (String str : results) { if (isContainNotExist(str)) { l1.add(str); } else { l2.add(str); ... |
List | getDiffentElement(List get Diffent Element List<String> newList = new ArrayList<String>(); for (String max : maxList) { if (!(minList.contains(max))) { newList.add(max); return newList; |
List | getDifference(List get Difference final List<T> result = new ArrayList<T>(); for (final T elem1 : bigger) if (!smaller.contains(elem1)) result.add(elem1); return result; |
String | getDiffInfo(List get Diff Info int iIndex = 1; boolean isFind = false; String newItem = "NewItem"; do { isFind = false; for (String info : infoList) { if (info.equals(newItem)) { isFind = true; ... |