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

Method get

Ports/CLDC11/src/java/util/AbstractMap.java:414–432  ·  view source on GitHub ↗
(Object key)

Source from the content-addressed store, hash-verified

412 /// @return the value of the mapping with the specified key, or `null`
413 /// if no mapping for the specified key is found.
414 public V get(Object key) {
415 Iterator<Map.Entry<K, V>> it = entrySet().iterator();
416 if (key != null) {
417 while (it.hasNext()) {
418 Map.Entry<K, V> entry = it.next();
419 if (key.equals(entry.getKey())) {
420 return entry.getValue();
421 }
422 }
423 } else {
424 while (it.hasNext()) {
425 Map.Entry<K, V> entry = it.next();
426 if (entry.getKey() == null) {
427 return entry.getValue();
428 }
429 }
430 }
431 return null;
432 }
433
434 /// Returns the hash code for this object. Objects which are equal must
435 /// return the same value for this method.

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected