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

Method containsValue

Ports/CLDC11/src/java/util/HashMap.java:384–408  ·  view source on GitHub ↗
(Object value)

Source from the content-addressed store, hash-verified

382 /// @return `true` if this map contains the specified value,
383 /// `false` otherwise.
384 @Override
385 public boolean containsValue(Object value) {
386 if (value != null) {
387 for (int i = 0; i < elementData.length; i++) {
388 Entry<K, V> entry = elementData[i];
389 while (entry != null) {
390 if (areEqualValues(value, entry.value)) {
391 return true;
392 }
393 entry = entry.next;
394 }
395 }
396 } else {
397 for (int i = 0; i < elementData.length; i++) {
398 Entry<K, V> entry = elementData[i];
399 while (entry != null) {
400 if (entry.value == null) {
401 return true;
402 }
403 entry = entry.next;
404 }
405 }
406 }
407 return false;
408 }
409
410 /// Returns a set containing all of the mappings in this map. Each mapping is
411 /// an instance of `Map.Entry`. As the set is backed by this map,

Callers 1

containsMethod · 0.95

Calls 1

areEqualValuesMethod · 0.95

Tested by

no test coverage detected