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

Method hashCode

vm/JavaAPI/src/java/util/Hashtable.java:496–515  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

494 }
495
496 @Override
497 public synchronized int hashCode() {
498 int result = 0;
499 Iterator<Map.Entry<K, V>> it = entrySet().iterator();
500 while (it.hasNext()) {
501 Map.Entry<K, V> entry = it.next();
502 Object key = entry.getKey();
503 if (key == this) {
504 continue;
505 }
506 Object value = entry.getValue();
507 if (value == this) {
508 continue;
509 }
510 int hash = (key != null ? key.hashCode() : 0)
511 ^ (value != null ? value.hashCode() : 0);
512 result += hash;
513 }
514 return result;
515 }
516
517 /**
518 * Returns true if this {@code Hashtable} has no key/value pairs.

Callers

nothing calls this directly

Calls 7

entrySetMethod · 0.95
hashCodeMethod · 0.95
iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
getKeyMethod · 0.65
getValueMethod · 0.65

Tested by

no test coverage detected