List of utility methods to do List Compare
int | canonicalCompare(List extends U> o1, List extends U> o2, Comparator super U> elemComparator) Compares two List s with respect to canonical ordering. int siz1 = o1.size(), siz2 = o2.size(); if (siz1 != siz2) { return siz1 - siz2; return lexCompare(o1, o2, elemComparator); |
int | compare(List lhs, Collection rhs, List standard) Compare two Collections by reference to a standard List. int result = compare(lhs, rhs); if (result == Integer.MAX_VALUE) { if (null == standard) { result = compare(lhs, rhs, lhs); } else { boolean leftHasThem = lhs.containsAll(standard); boolean rightHasThem = rhs.containsAll(standard); if (leftHasThem != rightHasThem) { ... |
int | compare(List compare int comp = EQUAL; for (int i = 0; i < sortKeys.length; i++) { if (sortKeys[i] < 0) { continue; boolean asc = true; try { asc = sortAscending[i]; ... |
List | compare(List Verifies that list2 contains the items of list1 and returns the list of the items from list1 that don't belong to list2 List<Integer> badList = new ArrayList<Integer>(); for (Integer i : list1) { if (!list2.contains(i)) { badList.add(i); return badList; |
int | compare(List compare if (a.size() == 0 || b.size() == 0) { return 0; if (a.size() <= b.size()) { for (String x : a) { boolean z = false; for (String y : b) { if (x.equals(y)) { ... |
boolean | compare(List Compare this two list whether equal List<String> list1 = strList1 == null ? new ArrayList<String>() : strList1; List<String> list2 = strList2 == null ? new ArrayList<String>() : strList2; if (list1.size() != list2.size()) { return false; for (String str1 : list1) { boolean isFound = false; int index = 0; ... |
boolean | compare(List compare if (a.size() != b.size()) return false; Collections.sort(a); Collections.sort(b); for (int i = 0; i < a.size(); i++) { if (!a.get(i).equals(b.get(i))) return false; return true; |
boolean | compare(String str, List compare String x = str.replace(" ", ""); x = x.replace("[", "").replace("]", ""); String y = list.toString().replace(" ", ""); y = y.replace("[", "").replace("]", ""); return x.equals(y); |
int | compareByList(List Compare two items, with the ordering determined by a list of those items. if (a == null) { if (b == null) { return 0; } else { return -1; } else { if (b == null) { ... |
String | compareFileLists(List compare File Lists StringBuilder sb = new StringBuilder( "Expected (" + expected.size() + "): \t\t Gotten (" + gotten.size() + "):\n"); List<String> notFound = new ArrayList<>(); for (String s : expected) { if (gotten.contains(s)) sb.append(s + "\t\t" + s + "\n"); else notFound.add(s); ... |