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

Method containsValue

lib/java/util/HashMap.java:411–435  ·  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

409 * {@code false} otherwise.
410 */
411 @Override
412 public boolean containsValue(Object value) {
413 if (value != null) {
414 for (int i = 0; i < elementData.length; i++) {
415 Entry<K, V> entry = elementData[i];
416 while (entry != null) {
417 if (areEqualValues(value, entry.value)) {
418 return true;
419 }
420 entry = entry.next;
421 }
422 }
423 } else {
424 for (int i = 0; i < elementData.length; i++) {
425 Entry<K, V> entry = elementData[i];
426 while (entry != null) {
427 if (entry.value == null) {
428 return true;
429 }
430 entry = entry.next;
431 }
432 }
433 }
434 return false;
435 }
436
437 /**
438 * Returns a set containing all of the mappings in this map. Each mapping is

Callers 1

containsMethod · 0.95

Calls 1

areEqualValuesMethod · 0.95

Tested by

no test coverage detected