Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for RemovalNotification (0.1 sec)

  1. android/guava/src/com/google/common/cache/RemovalNotification.java

       * null} if they were already garbage collected.
       *
       * @since 19.0
       */
      public static <K, V> RemovalNotification<K, V> create(
          @CheckForNull K key, @CheckForNull V value, RemovalCause cause) {
        return new RemovalNotification<>(key, value, cause);
      }
    
      private RemovalNotification(@CheckForNull K key, @CheckForNull V value, RemovalCause cause) {
        super(key, value);
        this.cause = checkNotNull(cause);
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 01 20:46:24 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/cache/NullCacheTest.java

                .maximumSize(0)
                .removalListener(listener)
                .build(constantLoader(computed));
    
        Object key = new Object();
        assertSame(computed, cache.getUnchecked(key));
        RemovalNotification<Object, Object> notification = listener.remove();
        assertSame(key, notification.getKey());
        assertSame(computed, notification.getValue());
        assertSame(RemovalCause.SIZE, notification.getCause());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/cache/NullCacheTest.java

                .maximumSize(0)
                .removalListener(listener)
                .build(constantLoader(computed));
    
        Object key = new Object();
        assertSame(computed, cache.getUnchecked(key));
        RemovalNotification<Object, Object> notification = listener.remove();
        assertSame(key, notification.getKey());
        assertSame(computed, notification.getValue());
        assertSame(RemovalCause.SIZE, notification.getCause());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/cache/CacheBuilderTest.java

        // contain the computed value (b -> b), since the clear() happened before the computation
        // completed.
        assertEquals(1, listener.size());
        RemovalNotification<String, String> notification = listener.remove();
        assertEquals("a", notification.getKey());
        assertEquals("a", notification.getValue());
        assertEquals(1, cache.size());
    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. guava-tests/test/com/google/common/cache/LocalCacheTest.java

      }
    
      public void testComputeIfAbsent_removalListener() {
        List<RemovalNotification<Object, Object>> notifications = new ArrayList<>();
        RemovalListener<Object, Object> removalListener =
            new RemovalListener<Object, Object>() {
              @Override
              public void onRemoval(RemovalNotification<Object, Object> notification) {
                notifications.add(notification);
              }
            };
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 112.3K bytes
    - Viewed (0)
  6. guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LocalCache.java

      private long currentTimeNanos() {
        return ticker.read();
      }
    
      private void alertListenerIfPresent(K key, V value, RemovalCause cause) {
        if (removalListener != null) {
          removalListener.onRemoval(RemovalNotification.create(key, value, cause));
        }
      }
    
      @SuppressWarnings("GoodTime") // timestamps as numeric primitives
      private V load(K key) throws ExecutionException {
        long startTime = ticker.read();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 27 19:19:19 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/cache/LocalCacheTest.java

        final RuntimeException e = new RuntimeException();
        RemovalListener<Object, Object> listener =
            new RemovalListener<Object, Object>() {
              @Override
              public void onRemoval(RemovalNotification<Object, Object> notification) {
                throw e;
              }
            };
    
        CacheBuilder<Object, Object> builder = createCacheBuilder().removalListener(listener);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 110.6K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java

        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()) {
                  case EXPIRED:
                    stats[0]++;
                    break;
                  case EXPLICIT:
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 14.4K bytes
    - Viewed (0)
  9. guava/src/com/google/common/cache/LocalCache.java

          totalWeight -= weight;
          if (cause.wasEvicted()) {
            statsCounter.recordEviction();
          }
          if (map.removalNotificationQueue != DISCARDING_QUEUE) {
            RemovalNotification<K, V> notification = RemovalNotification.create(key, value, cause);
            map.removalNotificationQueue.offer(notification);
          }
        }
    
        /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 149.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/cache/CacheBuilder.java

              return new SimpleStatsCounter();
            }
          };
    
      enum NullListener implements RemovalListener<Object, Object> {
        INSTANCE;
    
        @Override
        public void onRemoval(RemovalNotification<Object, Object> notification) {}
      }
    
      enum OneWeigher implements Weigher<Object, Object> {
        INSTANCE;
    
        @Override
        public int weigh(Object key, Object value) {
          return 1;
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 52K bytes
    - Viewed (0)
Back to top