Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for getAndAdd (0.06 sec)

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

        assertEquals(0L, map.get(key));
        assertFalse(map.containsKey(key));
    
        assertEquals(0L, map.getAndAdd(key, value));
        assertEquals(value, map.get(key));
    
        assertEquals(value, map.getAndAdd(key, -1 * value));
        assertEquals(0L, map.get(key));
        assertTrue(map.containsKey(key));
    
        assertEquals(0L, map.getAndAdd(key, value));
        assertEquals(value, map.get(key));
      }
    
      public void testPut() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 13 14:28:25 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java

          assertBitEquals(prev, at.getAndSet(x));
          prev = x;
        }
      }
    
      /** getAndAdd returns previous value and adds given value */
      public void testGetAndAdd() {
        for (double x : VALUES) {
          for (double y : VALUES) {
            AtomicDouble a = new AtomicDouble(x);
            double z = a.getAndAdd(y);
            assertBitEquals(x, z);
            assertBitEquals(x + y, a.get());
          }
        }
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  3. guava/src/com/google/common/util/concurrent/AtomicLongMap.java

       */
      @CanIgnoreReturnValue
      public long getAndIncrement(K key) {
        return getAndAdd(key, 1);
      }
    
      /**
       * Decrements by one the value currently associated with {@code key}, and returns the old value.
       */
      @CanIgnoreReturnValue
      public long getAndDecrement(K key) {
        return getAndAdd(key, -1);
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java

            prev = x;
          }
        }
      }
    
      /** getAndAdd returns previous value and adds given value */
      public void testGetAndAdd() {
        AtomicDoubleArray aa = new AtomicDoubleArray(SIZE);
        for (int i : new int[] {0, SIZE - 1}) {
          for (double x : VALUES) {
            for (double y : VALUES) {
              aa.set(i, x);
              double z = aa.getAndAdd(i, y);
              assertBitEquals(x, z);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/AtomicLongMap.java

       */
      @CanIgnoreReturnValue
      public long getAndIncrement(K key) {
        return getAndAdd(key, 1);
      }
    
      /**
       * Decrements by one the value currently associated with {@code key}, and returns the old value.
       */
      @CanIgnoreReturnValue
      public long getAndDecrement(K key) {
        return getAndAdd(key, -1);
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  6. guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java

       *
       * @param i the index
       * @param delta the value to add
       * @return the previous value
       */
      @CanIgnoreReturnValue
      public final double getAndAdd(int i, double delta) {
        return getAndAccumulate(i, delta, Double::sum);
      }
    
      /**
       * Atomically adds the given value to the element at index {@code i}.
       *
       * @param i the index
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jun 14 17:55:55 UTC 2024
    - 10.3K bytes
    - Viewed (0)
Back to top