Home
last modified time | relevance | path

Searched refs:computeIfAbsent (Results 1 – 25 of 46) sorted by relevance

12

/libcore/luni/src/test/java/libcore/java/util/
DMapDefaultMethodTester.java303 assertEquals(5.0, m.computeIfAbsent(1, (k) -> 5.0 * k)); in test_computeIfAbsent()
308 assertEquals(1.0, m.computeIfAbsent(1, k -> 6.0 * k)); in test_computeIfAbsent()
313 assertEquals(1.0, m.computeIfAbsent(1, k -> null)); in test_computeIfAbsent()
317 assertNull(m.computeIfAbsent(100, k-> null)); in test_computeIfAbsent()
321 m.computeIfAbsent(1, null); in test_computeIfAbsent()
328 assertEquals(1.0, m.computeIfAbsent(1, k -> 1.0)); in test_computeIfAbsent()
334 assertEquals(1.0, m.computeIfAbsent(null, (k) -> 5.0 * k)); in test_computeIfAbsent()
337 m.computeIfAbsent(null, k -> 5.0); in test_computeIfAbsent()
DCollectionsTest.java543 Collections.unmodifiableMap(new HashMap<>()).computeIfAbsent(1, k -> 1.0); in test_unmodifiableMap_computeIfAbsent()
552 Collections.unmodifiableMap(m).computeIfAbsent(1, k -> 1.0); in test_unmodifiableMap_computeIfAbsent()
926 assertThrowsUoe(() -> { map.computeIfAbsent(absentKey, k -> absentValue); }); in check_unmodifiableOrderedMap_defaultMethods()
938 assertThrowsUoe(() -> { map.computeIfAbsent(sampleKey, k -> absentValue); }); in check_unmodifiableOrderedMap_defaultMethods()
1035 assertThrowsCce(() -> { map.computeIfAbsent(new Object(), k -> presentValue); }); in check_map_isChecked()
1037 assertEquals(presentValue, map.computeIfAbsent(presentKey, k -> new Object())); in check_map_isChecked()
1038 assertThrowsCce(() -> { map.computeIfAbsent(absentKey, k -> new Object()); }); in check_map_isChecked()
1252 Collections.emptyMap().computeIfAbsent(1, k -> 5.0); in test_EmptyMap_computeIfAbsent()
1329 Collections.singletonMap(1, 11.0).computeIfAbsent(1, k -> 5.0); in test_SingletonMap_computeIfAbsent()
1570 assertSame(A_STRING, checkedMap2.computeIfAbsent(1, k -> { in test_CheckedMap_computeIfAbsent()
[all …]
DLinkedHashMapTest.java148 m.computeIfAbsent("key1", (k) -> "value3"); in test_computeIfAbsent()
157 m.computeIfAbsent("key4", (k) -> "value3"); in test_computeIfAbsent()
/libcore/ojluni/src/main/java/java/nio/charset/
DCoderResult.java222 return Cache.INSTANCE.malformed.computeIfAbsent(length, in malformedForLength()
247 return Cache.INSTANCE.unmappable.computeIfAbsent(length, in unmappableForLength()
/libcore/ojluni/src/test/java/util/LinkedHashMap/
DComputeIfAbsentAccessOrder.java41 map.computeIfAbsent("first", l -> null); // should do nothing in main()
DBasic.java215 Assert.assertTrue(x.equals(m.computeIfAbsent(x, Integer::valueOf))); in testBasic()
/libcore/ojluni/src/test/java/util/Map/
DDefaults.java289 assertSame(map.computeIfAbsent(null, (k) -> null), null, "not expected result"); in testComputeIfAbsentNulls()
292 … assertSame(map.computeIfAbsent(null, (k) -> EXTRA_VALUE), EXTRA_VALUE, "not mapped to result"); in testComputeIfAbsentNulls()
299 … assertSame(map.computeIfAbsent(null, (k) -> EXTRA_VALUE), EXTRA_VALUE, "not mapped to result"); in testComputeIfAbsentNulls()
312 assertSame(map.computeIfAbsent(KEYS[1], (k) -> EXTRA_VALUE), expected, description); in testComputeIfAbsent()
317 assertNull(map.computeIfAbsent(EXTRA_KEY, (k) -> null)); in testComputeIfAbsent()
319 assertSame(map.computeIfAbsent(EXTRA_KEY, (k) -> EXTRA_VALUE), EXTRA_VALUE); in testComputeIfAbsent()
326 assertThrowsNPE(() -> map.computeIfAbsent(KEYS[1], null)); in testComputeIfAbsentNullFunction()
559 assertNull(map.computeIfAbsent(two, f)); in testConcurrentMap_computeIfAbsent_racy()
564 assertEquals(42L, (long)map.computeIfAbsent(two, f)); in testConcurrentMap_computeIfAbsent_racy()
569 assertEquals(99L, (long)map.computeIfAbsent(two, f)); in testConcurrentMap_computeIfAbsent_racy()
/libcore/ojluni/src/test/java/util/Collections/
DDelegatingIteratorForEachRemaining.java145 …@Override public V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) { retu… in computeIfAbsent() method in DelegatingIteratorForEachRemaining.ForwardingMap
/libcore/ojluni/annotations/flagged_api/java/util/
DHashMap.annotated.java74 public V computeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingFunction)… in computeIfAbsent() method in HashMap
DTreeMap.annotated.java67 public V computeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingFunction)… in computeIfAbsent() method in TreeMap
DProperties.annotated.java124 public synchronized java.lang.Object computeIfAbsent(java.lang.Object key, java.util.function.Funct… in computeIfAbsent() method in Properties
DMap.annotated.java74 public default V computeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingF… in computeIfAbsent() method
/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentMap.java325 default V computeIfAbsent(K key, in computeIfAbsent() method
/libcore/luni/src/test/java/libcore/java/lang/
DSystemTest.java191 System.getProperties().computeIfAbsent("user.dir", (key) -> "meh"); in testSystemProperties_immutable()
/libcore/ojluni/annotations/mmodule/java/security/
DProvider.annotated.java77 public synchronized java.lang.Object computeIfAbsent(java.lang.Object key, java.util.function.Funct… in computeIfAbsent() method in Provider
/libcore/ojluni/annotations/flagged_api/java/util/concurrent/
DConcurrentSkipListMap.annotated.java70 public V computeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingFunction)… in computeIfAbsent() method in ConcurrentSkipListMap
/libcore/ojluni/annotations/sdk/nullability/java/util/
DHashMap.annotated.java75 @libcore.util.Nullable public V computeIfAbsent(@libcore.util.NullFromTypeParam K key, @libcore.uti… in computeIfAbsent() method in HashMap
/libcore/ojluni/src/test/java/util/concurrent/tck/
DConcurrentHashMap8Test.java94 map.computeIfAbsent(six, x -> "Z"); in testComputeIfAbsent()
103 assertEquals("A", map.computeIfAbsent(one, x -> "Z")); in testComputeIfAbsent2()
111 map.computeIfAbsent(six, x -> null); in testComputeIfAbsent3()
1139 result += map.computeIfAbsent(i % mapSize, k -> k + k); in testcomputeIfAbsent_performance()
/libcore/ojluni/src/main/java/java/util/stream/
DCollectors.java1144 A container = m.computeIfAbsent(key, k -> downstreamSupplier.get());
1307 A resultContainer = m.computeIfAbsent(key, k -> downstreamSupplier.get());
1314 A resultContainer = m.computeIfAbsent(key, k -> downstreamSupplier.get());
/libcore/ojluni/src/main/java/java/security/
DProvider.java546 …public synchronized Object computeIfAbsent(Object key, Function<? super Object, ? extends Object> … in computeIfAbsent() method in Provider
840 legacyStrings.computeIfAbsent((String) key, in implComputeIfAbsent()
843 return super.computeIfAbsent(key, mappingFunction); in implComputeIfAbsent()
/libcore/ojluni/src/main/java/java/lang/
DSystem.java957 public synchronized Object computeIfAbsent(Object key, in computeIfAbsent() method in System.PropertiesWithNonOverrideableDefaults
960 return super.computeIfAbsent(key, mappingFunction); in computeIfAbsent()
/libcore/ojluni/src/main/java/java/util/
DProperties.java1475 public synchronized Object computeIfAbsent(Object key, in computeIfAbsent() method in Properties
1477 return map.computeIfAbsent(key, mappingFunction); in computeIfAbsent()
DLinkedHashMap.java1244 public V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) { in computeIfAbsent() method in LinkedHashMap.ReversedLinkedHashMapView
1245 return base.computeIfAbsent(key, mappingFunction); in computeIfAbsent()
DMap.java1048 default V computeIfAbsent(K key, in computeIfAbsent() method
/libcore/jsr166-tests/src/test/java/jsr166/
DConcurrentHashMap8Test.java70 map.computeIfAbsent(six, (x) -> "Z"); in testComputeIfAbsent()
79 assertEquals("A", map.computeIfAbsent(one, (x) -> "Z")); in testComputeIfAbsent2()
87 map.computeIfAbsent(six, (x) -> null); in testComputeIfAbsent3()

12