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

Method get

lib/java/util/AbstractMap.java:167–185  ·  view source on GitHub ↗

Returns the value of the mapping with the specified key. @param key the key. @return the value of the mapping with the specified key, or null if no mapping for the specified key is found.

(Object key)

Source from the content-addressed store, hash-verified

165 * if no mapping for the specified key is found.
166 */
167 public V get(Object key) {
168 Iterator<Map.Entry<K, V>> it = entrySet().iterator();
169 if (key != null) {
170 while (it.hasNext()) {
171 Map.Entry<K, V> entry = it.next();
172 if (key.equals(entry.getKey())) {
173 return entry.getValue();
174 }
175 }
176 } else {
177 while (it.hasNext()) {
178 Map.Entry<K, V> entry = it.next();
179 if (entry.getKey() == null) {
180 return entry.getValue();
181 }
182 }
183 }
184 return null;
185 }
186
187 /**
188 * Returns the hash code for this object. Objects which are equal must

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