MCPcopy Create free account
hub / github.com/davidgiven/luje / equals

Method equals

lib/java/util/AbstractList.java:479–500  ·  view source on GitHub ↗

Compares the specified object to this list and return true if they are equal. Two lists are equal when they both contain the same objects in the same order. @param object the object to compare to this object. @return true if the specified object is equal to this list, {@c

(Object object)

Source from the content-addressed store, hash-verified

477 * @see #hashCode
478 */
479 @Override
480 public boolean equals(Object object) {
481 if (this == object) {
482 return true;
483 }
484 if (object instanceof List) {
485 List<?> list = (List<?>) object;
486 if (list.size() != size()) {
487 return false;
488 }
489
490 Iterator<?> it1 = iterator(), it2 = list.iterator();
491 while (it1.hasNext()) {
492 Object e1 = it1.next(), e2 = it2.next();
493 if (!(e1 == null ? e2 == null : e1.equals(e2))) {
494 return false;
495 }
496 }
497 return true;
498 }
499 return false;
500 }
501
502 /**
503 * Returns the element at the specified location in this list.

Callers

nothing calls this directly

Calls 6

iteratorMethod · 0.95
equalsMethod · 0.95
sizeMethod · 0.65
iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected