Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for newValue (0.18 sec)

  1. guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java

        String key = "key";
        long newValue = random.nextInt(MAX_ADDEND);
        for (int i = 0; i < ITERATIONS; i++) {
          long before = map.get(key);
          long result = map.put(key, newValue);
          long after = map.get(key);
          assertEquals(newValue, after);
          assertEquals(before, result);
          newValue += newValue;
        }
        assertEquals(1, map.size());
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 17.4K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/util/concurrent/AtomicLongMap.java

                return delta;
              }
              // atomic replaced
              continue outer;
            }
    
            long newValue = oldValue + delta;
            if (atomic.compareAndSet(oldValue, newValue)) {
              return newValue;
            }
            // value changed
          }
        }
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

            Entry<Object, Object> entry = warmed.get(i - WARMUP_MIN);
            Object newValue = new Object();
            assertSame(entry.getValue(), cache.asMap().put(entry.getKey(), newValue));
            // don't let the new entry get GCed
            warmed.add(entryOf(entry.getKey(), newValue));
            Object newKey = new Object();
            assertNull(cache.asMap().put(newKey, entry.getValue()));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 15K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java

        String key = "key";
        long newValue = random.nextInt(MAX_ADDEND);
        for (int i = 0; i < ITERATIONS; i++) {
          long before = map.get(key);
          long result = map.put(key, newValue);
          long after = map.get(key);
          assertEquals(newValue, after);
          assertEquals(before, result);
          newValue += newValue;
        }
        assertEquals(1, map.size());
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 17.4K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java

        assertEquals(0, segment.count);
    
        // same value
        segment.setTableEntryForTesting(index, entry);
        segment.count++;
        assertEquals(1, segment.count);
        assertSame(oldValue, segment.get(key, hash));
        assertTrue(segment.replace(key, hash, oldValue, newValue));
        assertEquals(1, segment.count);
        assertSame(newValue, segment.get(key, hash));
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 35.1K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/collect/MapMakerInternalMapTest.java

        assertEquals(0, segment.count);
    
        // same value
        segment.setTableEntryForTesting(index, entry);
        segment.count++;
        assertEquals(1, segment.count);
        assertSame(oldValue, segment.get(key, hash));
        assertTrue(segment.replace(key, hash, oldValue, newValue));
        assertEquals(1, segment.count);
        assertSame(newValue, segment.get(key, hash));
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 35.1K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

            Entry<Object, Object> entry = warmed.get(i - WARMUP_MIN);
            Object newValue = new Object();
            assertSame(entry.getValue(), cache.asMap().put(entry.getKey(), newValue));
            // don't let the new entry get GCed
            warmed.add(entryOf(entry.getKey(), newValue));
            Object newKey = new Object();
            assertNull(cache.asMap().put(newKey, entry.getValue()));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 15K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/ConcurrentHashMultiset.java

          }
    
          while (true) {
            int oldValue = existingCounter.get();
            if (oldValue != 0) {
              try {
                int newValue = IntMath.checkedAdd(oldValue, occurrences);
                if (existingCounter.compareAndSet(oldValue, newValue)) {
                  // newValue can't == 0, so no need to check & remove
                  return oldValue;
                }
              } catch (ArithmeticException overflow) {
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/CollectCollectors.java

               * nullness checker.
               */
              K key = keyFunction.apply(t);
              V newValue = valueFunction.apply(t);
              accum.put(
                  checkNotNull(key, "Null key for input %s", t),
                  checkNotNull(newValue, "Null value for input %s", t));
            },
            EnumMapAccumulator::combine,
            EnumMapAccumulator::toImmutableMap,
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:21:40 GMT 2024
    - 17.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java

          }
    
          while (true) {
            int oldValue = existingCounter.get();
            if (oldValue != 0) {
              try {
                int newValue = IntMath.checkedAdd(oldValue, occurrences);
                if (existingCounter.compareAndSet(oldValue, newValue)) {
                  // newValue can't == 0, so no need to check & remove
                  return oldValue;
                }
              } catch (ArithmeticException overflow) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 20.9K bytes
    - Viewed (0)
Back to top