MCPcopy Create free account
hub / github.com/antlr/codebuff / elementsEqual

Method elementsEqual

output/java_guava/1.4.18/Iterables.java:276–285  ·  view source on GitHub ↗

Determines whether two iterables contain equal elements in the same order. More specifically, this method returns true if iterable1 and iterable2 contain the same number of elements and every element of iterable1 is equal to the corresponding element of {@code iterabl

(Iterable<?> iterable1, Iterable<?> iterable2)

Source from the content-addressed store, hash-verified

274
275
276 public static boolean elementsEqual(Iterable<?> iterable1, Iterable<?> iterable2) {
277 if (iterable1 instanceof Collection && iterable2 instanceof Collection) {
278 Collection<?> collection1 = (Collection<?>) iterable1;
279 Collection<?> collection2 = (Collection<?>) iterable2;
280 if (collection1.size() != collection2.size()) {
281 return false;
282 }
283 }
284 return Iterators.elementsEqual(iterable1.iterator(), iterable2.iterator());
285 }
286
287 /**
288 * Returns a string representation of {@code iterable}, with the format {@code

Callers

nothing calls this directly

Calls 3

elementsEqualMethod · 0.95
sizeMethod · 0.65
iteratorMethod · 0.65

Tested by

no test coverage detected