List of utility methods to do List Compare
int | compareLists(List Provides a consistent ordering over lists. if (list1 == null && list2 == null) return 0; if (list1 == null || list2 == null) { throw new IllegalArgumentException(); int size1 = list1.size(); int size2 = list2.size(); int size = Math.min(size1, size2); ... |
boolean | compareLists(Object obj1, Object obj2) compare Lists if (null == obj1 && null == obj2) { return true; } else if (null != obj1 && null != obj2) { if (obj1 instanceof List && obj2 instanceof List) { if (((List) obj1).size() != ((List) obj2).size()) { return false; } else { Set set = new HashSet(); ... |
boolean | compareLists(String list1[], String list2[]) Compares two lists of strings if (null == list1 || null == list2) { return false; int size = list1.length; if (size != list2.length) { return false; java.util.Arrays.sort(list1); ... |
boolean | compareListsAndNull(List arg1, List arg2) compare Lists And Null if (arg1 == null && arg2 == null) { return true; } else if ((arg1 == null && arg2 != null) || (arg1 != null && arg2 == null) || arg1.size() != arg2.size()) { return false; } else { for (int i = 0; i < arg1.size(); i++) { if (!compareObjectsAndNull(arg1.get(i), arg2.get(i))) { return false; ... |
boolean | comparer(Comparator comparer return Arrays.stream(withList).noneMatch(with -> comparator.compare(object, with) != 0);
|
boolean | compareStringList(List Compare the given lists of strings. if (list1.size() == list2.size()) { ArrayList<String> l1 = new ArrayList<String>(list1); ArrayList<String> l2 = new ArrayList<String>(list2); Comparator<String> c = new Comparator<String>() { public int compare(String o1, String o2) { return o1.compareToIgnoreCase(o2); }; ... |
boolean | compareStringLists(List Compare two array lists, if any of the elements in elements1 matches to either one of the element in elements2, return true else return false. for (String element1 : elements1) { for (String element2 : elements2) { if (element1.equals(element2)) { return true; return false; ... |
boolean | compareSubstring(List compare Substring boolean result = true; int len = pieces.size(); if (len == 1) { return s.equals(pieces.get(0)); int index = 0; loop: for (int i = 0; i < len; i++) { String piece = pieces.get(i); ... |
int | compareTermList(final List Compare two term lists by comparing their subterms in order. int minSize = Math.min(tl0.size(), tl1.size()); int compare = 0; for (int i = 0; (compare == 0) && (i < minSize); ++i) { compare = tl0.get(i).compareTo(tl1.get(i)); if (compare == 0) { compare = tl1.size() - tl0.size(); if (compare < 0) { return -1; } else if (compare > 0) { return 1; } else { return 0; |
int | compareTo(List compare To return list.get(i).compareTo(list.get(j));
|