Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for getAndSet (0.1 sec)

  1. guava/src/com/google/common/collect/AbstractMapBasedMultiset.java

        Count existingCounter;
        int oldCount;
        if (count == 0) {
          existingCounter = backingMap.remove(element);
          oldCount = getAndSet(existingCounter, count);
        } else {
          existingCounter = backingMap.get(element);
          oldCount = getAndSet(existingCounter, count);
    
          if (existingCounter == null) {
            backingMap.put(element, new Count(count));
          }
        }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/CountTest.java

      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() {
        Count holder = new Count(10);
        holder.set(20);
        assertEquals(20, holder.get());
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Feb 19 20:34:55 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/collect/CountTest.java

      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() {
        Count holder = new Count(10);
        holder.set(20);
        assertEquals(20, holder.get());
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Feb 19 20:34:55 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  4. guava-testlib/test/com/google/common/collect/testing/MapTestSuiteBuilderTests.java

              public void run() {
                assertFalse("previous tearDown should have run before setUp", setUpRan.getAndSet(true));
              }
            };
        Runnable tearDown =
            new Runnable() {
              @Override
              public void run() {
                assertTrue("setUp should have run", setUpRan.getAndSet(false));
              }
            };
        return MapTestSuiteBuilder.using(new CheckSetUpHashMapGenerator(setUpRan))
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Apr 19 19:24:36 UTC 2023
    - 11.9K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java

          }
          assertBitEquals(x, at.get());
          prev = x;
        }
      }
    
      /** getAndSet returns previous value and sets to given value */
      public void testGetAndSet() {
        double prev = Math.E;
        AtomicDouble at = new AtomicDouble(prev);
        for (double x : VALUES) {
          assertBitEquals(prev, at.getAndSet(x));
          prev = x;
        }
      }
    
      /** getAndAdd returns previous value and adds given value */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  6. android/guava-testlib/test/com/google/common/collect/testing/MapTestSuiteBuilderTests.java

              public void run() {
                assertFalse("previous tearDown should have run before setUp", setUpRan.getAndSet(true));
              }
            };
        Runnable tearDown =
            new Runnable() {
              @Override
              public void run() {
                assertTrue("setUp should have run", setUpRan.getAndSet(false));
              }
            };
        return MapTestSuiteBuilder.using(new CheckSetUpHashMapGenerator(setUpRan))
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Apr 19 19:24:36 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  7. guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java

       *
       * @param i the index
       * @param newValue the new value
       * @return the previous value
       */
      public final double getAndSet(int i, double newValue) {
        long next = doubleToRawLongBits(newValue);
        return longBitsToDouble(longs.getAndSet(i, next));
      }
    
      /**
       * Atomically sets the element at position {@code i} to the given updated value if the current
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Jun 14 17:55:55 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java

            prev = x;
          }
        }
      }
    
      /** getAndSet returns previous value and sets to given value at given index */
      public void testGetAndSet() {
        AtomicDoubleArray aa = new AtomicDoubleArray(SIZE);
        for (int i : new int[] {0, SIZE - 1}) {
          double prev = 0.0;
          for (double x : VALUES) {
            assertBitEquals(prev, aa.getAndSet(i, x));
            prev = x;
          }
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb/SmbTreeImpl.java

                    if ( waitForState(transport) == 2 ) {
                        // already connected
                        return null;
                    }
                    int before = this.connectionState.getAndSet(1);
                    if ( before == 1 ) {
                        // concurrent connection attempt
                        if ( waitForState(transport) == 2 ) {
                            // finished connecting
    Registered: Sun Nov 03 00:10:13 UTC 2024
    - Last Modified: Thu Jan 05 13:06:39 UTC 2023
    - 29.6K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/InterruptibleTask.java

            // not all.  See the test cases for examples on how this can happen.
            try {
              ((Thread) currentRunner).interrupt();
            } finally {
              Runnable prev = getAndSet(DONE);
              if (prev == PARKED) {
                LockSupport.unpark((Thread) currentRunner);
              }
            }
          }
        }
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 10.1K bytes
    - Viewed (0)
Back to top