MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / equals

Method equals

vm/JavaAPI/src/java/util/AbstractList.java:480–501  ·  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

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