List of utility methods to do Iterable Compare
int | compareAsIterable( @Nonnull Comparator super T> comparator, @Nonnull Iterable extends T> it1, @Nonnull Iterable extends T> it2) compare As Iterable Iterator<? extends T> elements2 = it2.iterator(); for (T element1 : it1) { T element2; try { element2 = elements2.next(); } catch (NoSuchElementException ex) { return 1; int res = comparator.compare(element1, element2); if (res != 0) return res; if (elements2.hasNext()) { return -1; return 0; |
int | compareAsIterable( @Nonnull Iterable extends T> it1, @Nonnull Iterable extends T> it2) compare As Iterable Iterator<? extends T> elements2 = it2.iterator(); for (T element1 : it1) { T element2; try { element2 = elements2.next(); } catch (NoSuchElementException ex) { return 1; int res = element1.compareTo(element2); if (res != 0) return res; if (elements2.hasNext()) { return -1; return 0; |