MCPcopy Index your code
hub / github.com/davidgiven/luje / containsKey

Method containsKey

lib/java/util/AbstractMap.java:61–77  ·  view source on GitHub ↗

Returns whether this map contains the specified key. @param key the key to search for. @return true if this map contains the specified key, false otherwise.

(Object key)

Source from the content-addressed store, hash-verified

59 * {@code false} otherwise.
60 */
61 public boolean containsKey(Object key) {
62 Iterator<Map.Entry<K, V>> it = entrySet().iterator();
63 if (key != null) {
64 while (it.hasNext()) {
65 if (key.equals(it.next().getKey())) {
66 return true;
67 }
68 }
69 } else {
70 while (it.hasNext()) {
71 if (it.next().getKey() == null) {
72 return true;
73 }
74 }
75 }
76 return false;
77 }
78
79 /**
80 * Returns whether this map contains the specified value.

Callers 1

containsMethod · 0.95

Calls 6

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

Tested by

no test coverage detected