Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for putIfAbsent (0.18 sec)

  1. android/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapPutIfAbsentTester.java

        assertNull("putIfAbsent(notPresent, value) should return null", putIfAbsent(e3()));
        expectAdded(e3());
      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      @CollectionSize.Require(absent = ZERO)
      public void testPutIfAbsent_supportedPresent() {
        assertEquals(
            "putIfAbsent(present, value) should return existing value",
            v0(),
            getMap().putIfAbsent(k0(), v3()));
        expectUnchanged();
      }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/collect/testing/testers/MapPutIfAbsentTester.java

      public void testPutIfAbsent_supportedAbsent() {
        assertNull(
            "putIfAbsent(notPresent, value) should return null", getMap().putIfAbsent(k3(), v3()));
        expectAdded(e3());
      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      @CollectionSize.Require(absent = ZERO)
      public void testPutIfAbsent_supportedPresent() {
        assertEquals(
            "putIfAbsent(present, value) should return existing value",
            v0(),
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jun 26 18:17:52 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  3. guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapPutIfAbsentTester.java

        assertNull("putIfAbsent(notPresent, value) should return null", putIfAbsent(e3()));
        expectAdded(e3());
      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      @CollectionSize.Require(absent = ZERO)
      public void testPutIfAbsent_supportedPresent() {
        assertEquals(
            "putIfAbsent(present, value) should return existing value",
            v0(),
            getMap().putIfAbsent(k0(), v3()));
        expectUnchanged();
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  4. maven-core/src/main/java/org/apache/maven/project/Graph.java

        }
    
        private static List<String> visitAll(
                Collection<Vertex> children, Map<Vertex, DfsState> stateMap, List<String> list) {
            for (Vertex v : children) {
                DfsState state = stateMap.putIfAbsent(v, DfsState.VISITING);
                if (state == null) {
                    visitAll(v.children, stateMap, list);
                    stateMap.put(v, DfsState.VISITED);
                    list.add(v.label);
                }
            }
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Fri Sep 22 06:02:04 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java

        }
      }
    
      public void testPutIfAbsent() {
        TestMap map = new TestMap();
        map.put("foo", 1);
        assertEquals(Integer.valueOf(1), map.putIfAbsent("foo", 2));
        assertEquals(Integer.valueOf(1), map.get("foo"));
        assertNull(map.putIfAbsent("bar", 3));
        assertEquals(Integer.valueOf(3), map.get("bar"));
      }
    
      public void testRemove() {
        TestMap map = new TestMap();
        map.put("foo", 1);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.4K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/JdkBackedImmutableBiMap.java

          entryArray[i] = e;
          V oldValue = forwardDelegate.putIfAbsent(e.getKey(), e.getValue());
          if (oldValue != null) {
            throw conflictException("key", e.getKey() + "=" + oldValue, entryArray[i]);
          }
          K oldKey = backwardDelegate.putIfAbsent(e.getValue(), e.getKey());
          if (oldKey != null) {
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Nov 30 21:54:06 GMT 2023
    - 4.6K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/core/beans/factory/BeanDescFactory.java

     */
    package org.codelibs.core.beans.factory;
    
    import static org.codelibs.core.collection.CollectionsUtil.newConcurrentHashMap;
    import static org.codelibs.core.collection.CollectionsUtil.putIfAbsent;
    import static org.codelibs.core.misc.AssertionUtil.assertArgumentNotNull;
    
    import java.util.concurrent.ConcurrentMap;
    
    import org.codelibs.core.beans.BeanDesc;
    import org.codelibs.core.beans.impl.BeanDescImpl;
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java

        }
      }
    
      public void testPutIfAbsent() {
        TestMap map = new TestMap();
        map.put("foo", 1);
        assertEquals(Integer.valueOf(1), map.putIfAbsent("foo", 2));
        assertEquals(Integer.valueOf(1), map.get("foo"));
        assertNull(map.putIfAbsent("bar", 3));
        assertEquals(Integer.valueOf(3), map.get("bar"));
      }
    
      public void testRemove() {
        TestMap map = new TestMap();
        map.put("foo", 1);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.4K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/ForwardingConcurrentMap.java

      protected ForwardingConcurrentMap() {}
    
      @Override
      protected abstract ConcurrentMap<K, V> delegate();
    
      @CanIgnoreReturnValue
      @Override
      @CheckForNull
      public V putIfAbsent(K key, V value) {
        return delegate().putIfAbsent(key, value);
      }
    
      @CanIgnoreReturnValue
      @Override
      public boolean remove(@CheckForNull Object key, @CheckForNull Object value) {
        return delegate().remove(key, value);
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Jun 29 19:42:21 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  10. maven-core/src/main/java/org/apache/maven/internal/impl/Graph.java

        }
    
        private static List<String> visitAll(
                Collection<Vertex> children, Map<Vertex, DfsState> stateMap, List<String> list) {
            for (Vertex v : children) {
                DfsState state = stateMap.putIfAbsent(v, DfsState.VISITING);
                if (state == null) {
                    visitAll(v.children, stateMap, list);
                    stateMap.put(v, DfsState.VISITED);
                    list.add(v.label);
                }
            }
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Fri Apr 12 10:50:18 GMT 2024
    - 4.5K bytes
    - Viewed (0)
Back to top