Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for removalListener (0.08 sec)

  1. guava-tests/test/com/google/common/cache/CacheEvictionTest.java

      }
    
      public void testEviction_maxSize() {
        CountingRemovalListener<Integer, Integer> removalListener = countingRemovalListener();
        IdentityLoader<Integer> loader = identityLoader();
        LoadingCache<Integer, Integer> cache =
            CacheBuilder.newBuilder()
                .maximumSize(MAX_SIZE)
                .removalListener(removalListener)
                .build(loader);
        for (int i = 0; i < 2 * MAX_SIZE; i++) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 15K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/cache/LocalCacheTest.java

        RemovalListener<Object, Object> removalListener =
            new RemovalListener<Object, Object>() {
              @Override
              public void onRemoval(RemovalNotification<Object, Object> notification) {
                notifications.add(notification);
              }
            };
        Cache<Object, Object> cache =
            CacheBuilder.newBuilder().removalListener(removalListener).build();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 112.3K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/cache/LocalCacheTest.java

          refreshExecutor.shutdown();
        }
      }
    
      public void testSetRemovalListener() {
        RemovalListener<Object, Object> testListener = TestingRemovalListeners.nullRemovalListener();
        LocalCache<Object, Object> map =
            makeLocalCache(createCacheBuilder().removalListener(testListener));
        assertSame(testListener, map.removalListener);
      }
    
      public void testSetTicker() {
        Ticker testTicker =
            new Ticker() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 110.6K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/cache/CacheBuilderTest.java

      }
    
      public void testRemovalListener_setTwice() {
        RemovalListener<Object, Object> testListener = nullRemovalListener();
        CacheBuilder<Object, Object> builder = CacheBuilder.newBuilder().removalListener(testListener);
        assertThrows(IllegalStateException.class, () -> builder.removalListener(testListener));
      }
    
      public void testValuesIsNotASet() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 15:00:32 UTC 2024
    - 24.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/cache/CacheBuilder.java

       */
      public <K1 extends K, V1 extends V> CacheBuilder<K1, V1> removalListener(
          RemovalListener<? super K1, ? super V1> listener) {
        checkState(this.removalListener == null);
    
        // safely limiting the kinds of caches this can produce
        @SuppressWarnings("unchecked")
        CacheBuilder<K1, V1> me = (CacheBuilder<K1, V1>) this;
        me.removalListener = checkNotNull(listener);
        return me;
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 52K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/cache/CacheReferencesTest.java

      }
    
      // fails in Maven with 64-bit JDK: https://github.com/google/guava/issues/1568
    
      private void assertCleanup(
          LoadingCache<Integer, String> cache,
          CountingRemovalListener<Integer, String> removalListener) {
    
        // initialSize will most likely be 2, but it's possible for the GC to have already run, so we'll
        // observe a size of 1
        long initialSize = cache.size();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  7. guava/src/com/google/common/cache/CacheBuilder.java

       */
      public <K1 extends K, V1 extends V> CacheBuilder<K1, V1> removalListener(
          RemovalListener<? super K1, ? super V1> listener) {
        checkState(this.removalListener == null);
    
        // safely limiting the kinds of caches this can produce
        @SuppressWarnings("unchecked")
        CacheBuilder<K1, V1> me = (CacheBuilder<K1, V1>) this;
        me.removalListener = checkNotNull(listener);
        return me;
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 51.6K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java

        assertEquals("keyEquivalence", a.keyEquivalence, b.keyEquivalence);
        assertEquals("keyStrength", a.keyStrength, b.keyStrength);
        assertEquals("removalListener", a.removalListener, b.removalListener);
        assertEquals("weigher", a.weigher, b.weigher);
        assertEquals("valueEquivalence", a.valueEquivalence, b.valueEquivalence);
        assertEquals("valueStrength", a.valueStrength, b.valueStrength);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 19.1K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java

        assertEquals("keyEquivalence", a.keyEquivalence, b.keyEquivalence);
        assertEquals("keyStrength", a.keyStrength, b.keyStrength);
        assertEquals("removalListener", a.removalListener, b.removalListener);
        assertEquals("weigher", a.weigher, b.weigher);
        assertEquals("valueEquivalence", a.valueEquivalence, b.valueEquivalence);
        assertEquals("valueStrength", a.valueStrength, b.valueStrength);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 19.1K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java

        assertEquals(Integer.valueOf(50), asMap.get(10));
      }
    
      public void testRemovalListener() {
        final int[] stats = new int[4];
    
        RemovalListener<Integer, Integer> countingListener =
            new RemovalListener<Integer, Integer>() {
              @Override
              public void onRemoval(RemovalNotification<Integer, Integer> notification) {
                switch (notification.getCause()) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 14.4K bytes
    - Viewed (0)
Back to top