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

Method equals

lib/java/util/Vector.java:389–411  ·  view source on GitHub ↗

Compares the specified object to this vector and returns if they are equal. The object must be a List which contains the same objects in the same order. @param object the object to compare with this object @return true if the specified object is equal to this vector, {@co

(Object object)

Source from the content-addressed store, hash-verified

387 * @see #hashCode
388 */
389 @Override
390 public synchronized boolean equals(Object object) {
391 if (this == object) {
392 return true;
393 }
394 if (object instanceof List) {
395 List<?> list = (List<?>) object;
396 if (list.size() != elementCount) {
397 return false;
398 }
399
400 int index = 0;
401 Iterator<?> it = list.iterator();
402 while (it.hasNext()) {
403 Object e1 = elementData[index++], e2 = it.next();
404 if (!(e1 == null ? e2 == null : e1.equals(e2))) {
405 return false;
406 }
407 }
408 return true;
409 }
410 return false;
411 }
412
413 /**
414 * Returns the first element in this vector.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected