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

Method equals

vm/JavaAPI/src/java/util/Hashtable.java:435–457  ·  view source on GitHub ↗

Compares this Hashtable with the specified object and indicates if they are equal. In order to be equal, object must be an instance of Map and contain the same key/value pairs. @param object the object to compare with this object. @return true if the specified obj

(Object object)

Source from the content-addressed store, hash-verified

433 * @see #hashCode
434 */
435 @Override
436 public synchronized boolean equals(Object object) {
437 if (this == object) {
438 return true;
439 }
440 if (object instanceof Map) {
441 Map<?, ?> map = (Map<?, ?>) object;
442 if (size() != map.size()) {
443 return false;
444 }
445
446 Set<Map.Entry<K, V>> entries = entrySet();
447 Iterator it = map.entrySet().iterator();
448 while(it.hasNext()) {
449 Map.Entry<?, ?> e = (Map.Entry<?, ?>)it.next();
450 if (!entries.contains(e)) {
451 return false;
452 }
453 }
454 return true;
455 }
456 return false;
457 }
458
459 /**
460 * Returns the value associated with the specified key in this

Callers

nothing calls this directly

Calls 8

sizeMethod · 0.95
entrySetMethod · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
sizeMethod · 0.65
iteratorMethod · 0.65
entrySetMethod · 0.65
containsMethod · 0.65

Tested by

no test coverage detected