Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for addAndGet (0.17 sec)

  1. guava-tests/test/com/google/common/collect/CountTest.java

        assertEquals(20, holder.get());
        holder.add(1);
        assertEquals(21, holder.get());
      }
    
      public void testAddAndGet() {
        Count holder = new Count(20);
        assertEquals(21, holder.addAndGet(1));
      }
    
      public void testGetAndSet() {
        Count holder = new Count(10);
        assertEquals(10, holder.getAndSet(20));
        assertEquals(20, holder.get());
      }
    
      public void testSet() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Feb 19 20:34:55 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/Count.java

      private int value;
    
      Count(int value) {
        this.value = value;
      }
    
      public int get() {
        return value;
      }
    
      public void add(int delta) {
        value += delta;
      }
    
      public int addAndGet(int delta) {
        return value += delta;
      }
    
      public void set(int newValue) {
        value = newValue;
      }
    
      public int getAndSet(int newValue) {
        int result = value;
        value = newValue;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Aug 05 00:40:25 UTC 2021
    - 1.6K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java

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

       */
      @CanIgnoreReturnValue
      public long incrementAndGet(K key) {
        return addAndGet(key, 1);
      }
    
      /**
       * Decrements by one the value currently associated with {@code key}, and returns the new value.
       */
      @CanIgnoreReturnValue
      public long decrementAndGet(K key) {
        return addAndGet(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)
  5. android/guava-tests/test/com/google/common/collect/CountTest.java

        assertEquals(20, holder.get());
        holder.add(1);
        assertEquals(21, holder.get());
      }
    
      public void testAddAndGet() {
        Count holder = new Count(20);
        assertEquals(21, holder.addAndGet(1));
      }
    
      public void testGetAndSet() {
        Count holder = new Count(10);
        assertEquals(10, holder.getAndSet(20));
        assertEquals(20, holder.get());
      }
    
      public void testSet() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Feb 19 20:34:55 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/Count.java

      private int value;
    
      Count(int value) {
        this.value = value;
      }
    
      public int get() {
        return value;
      }
    
      public void add(int delta) {
        value += delta;
      }
    
      public int addAndGet(int delta) {
        return value += delta;
      }
    
      public void set(int newValue) {
        value = newValue;
      }
    
      public int getAndSet(int newValue) {
        int result = value;
        value = newValue;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Aug 05 00:40:25 UTC 2021
    - 1.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/AtomicLongMap.java

       */
      @CanIgnoreReturnValue
      public long incrementAndGet(K key) {
        return addAndGet(key, 1);
      }
    
      /**
       * Decrements by one the value currently associated with {@code key}, and returns the new value.
       */
      @CanIgnoreReturnValue
      public long decrementAndGet(K key) {
        return addAndGet(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)
  8. guava-tests/benchmark/com/google/common/cache/LoadingCacheSingleThreadBenchmark.java

        misses.set(0);
      }
    
      @Benchmark
      int time(int reps) {
        int dummy = 0;
        for (int i = 0; i < reps; i++) {
          dummy += cache.getUnchecked(nextRandomKey());
        }
        requests.addAndGet(reps);
        return dummy;
      }
    
      private int nextRandomKey() {
        int a = random.nextInt(max);
    
        /*
         * For example, if concentration=2.0, the following takes the square root of
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 3.4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java

            assertBitEquals(x + y, a.get());
          }
        }
      }
    
      /** addAndGet adds given value to current, and returns current value */
      public void testAddAndGet() {
        for (double x : VALUES) {
          for (double y : VALUES) {
            AtomicDouble a = new AtomicDouble(x);
            double z = a.addAndGet(y);
            assertBitEquals(x + y, 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)
  10. guava-tests/test/com/google/common/util/concurrent/AtomicLongMapBasherTest.java

                          case 1:
                            map.decrementAndGet(key);
                            threadSum--;
                            break;
                          case 2:
                            map.addAndGet(key, delta);
                            threadSum += delta;
                            break;
                          case 3:
                            map.getAndIncrement(key);
                            threadSum++;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 13 14:28:25 UTC 2024
    - 4.2K bytes
    - Viewed (0)
Back to top