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

Method containsValue

vm/JavaAPI/src/java/util/HashMap.java:378–402  ·  view source on GitHub ↗

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

(Object value)

Source from the content-addressed store, hash-verified

376 * {@code false} otherwise.
377 */
378 @Override
379 public boolean containsValue(Object value) {
380 if (value != null) {
381 for (int i = 0; i < elementData.length; i++) {
382 Entry<K, V> entry = elementData[i];
383 while (entry != null) {
384 if (areEqualKeys(value, entry.value)) {
385 return true;
386 }
387 entry = entry.next;
388 }
389 }
390 } else {
391 for (int i = 0; i < elementData.length; i++) {
392 Entry<K, V> entry = elementData[i];
393 while (entry != null) {
394 if (entry.value == null) {
395 return true;
396 }
397 entry = entry.next;
398 }
399 }
400 }
401 return false;
402 }
403
404 /**
405 * Returns a set containing all of the mappings in this map. Each mapping is

Callers 1

containsMethod · 0.95

Calls 1

areEqualKeysMethod · 0.95

Tested by

no test coverage detected