Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 26 for RemovalListener (0.28 seconds)

  1. guava/src/com/google/common/cache/RemovalListener.java

     *     Object} if any key is acceptable
     * @author Charles Fry
     * @since 10.0
     */
    @GwtCompatible
    @FunctionalInterface
    public interface RemovalListener<K, V> {
      /**
       * Notifies the listener that a removal occurred at some point in the past.
       *
       * <p>This does not always signify that the key is now absent from the cache, as it may have
       * already been re-added.
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sat Dec 21 03:10:51 GMT 2024
    - 2K bytes
    - Click Count (0)
  2. android/guava/src/com/google/common/cache/RemovalListener.java

     * @param <V> the most general type of values this listener can listen for; for example {@code
     *     Object} if any key is acceptable
     * @author Charles Fry
     * @since 10.0
     */
    @GwtCompatible
    public interface RemovalListener<K, V> {
      /**
       * Notifies the listener that a removal occurred at some point in the past.
       *
       * <p>This does not always signify that the key is now absent from the cache, as it may have
       * already been re-added.
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sat Dec 21 03:10:51 GMT 2024
    - 2K bytes
    - Click Count (0)
  3. android/guava/src/com/google/common/cache/RemovalListeners.java

      private RemovalListeners() {}
    
      /**
       * Returns a {@code RemovalListener} which processes all eviction notifications using {@code
       * executor}.
       *
       * @param listener the backing listener
       * @param executor the executor with which removal notifications are asynchronously executed
       */
      public static <K, V> RemovalListener<K, V> asynchronous(
          RemovalListener<K, V> listener, Executor executor) {
        checkNotNull(listener);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sat Dec 21 03:10:51 GMT 2024
    - 1.5K bytes
    - Click Count (0)
  4. guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/CapacityEnforcingMap.java

          boolean accessOrder,
          long maximumSize,
          StatsCounter statsCounter,
          @Nullable RemovalListener<? super K, ? super V> removalListener) {
        super(initialCapacity, loadFactor, accessOrder);
        this.maximumSize = maximumSize;
        this.statsCounter = statsCounter;
        this.removalListener = removalListener;
      }
    
      @Override
      protected boolean removeEldestEntry(Entry<K, Timestamped<V>> ignored) {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Feb 23 13:13:59 GMT 2026
    - 2.1K bytes
    - Click Count (0)
  5. 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++) {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 15K bytes
    - Click Count (0)
  6. android/guava-tests/test/com/google/common/cache/NullCacheTest.java

      }
    
      public void testGet() {
        Object computed = new Object();
        LoadingCache<Object, Object> cache =
            CacheBuilder.newBuilder()
                .maximumSize(0)
                .removalListener(listener)
                .build(constantLoader(computed));
    
        Object key = new Object();
        assertThat(cache.getUnchecked(key)).isSameInstanceAs(computed);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Dec 11 20:07:52 GMT 2025
    - 4.6K bytes
    - Click Count (0)
  7. guava/src/com/google/common/cache/RemovalListeners.java

      private RemovalListeners() {}
    
      /**
       * Returns a {@code RemovalListener} which processes all eviction notifications using {@code
       * executor}.
       *
       * @param listener the backing listener
       * @param executor the executor with which removal notifications are asynchronously executed
       */
      public static <K, V> RemovalListener<K, V> asynchronous(
          RemovalListener<K, V> listener, Executor executor) {
        checkNotNull(listener);
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Sat Dec 21 03:10:51 GMT 2024
    - 1.5K bytes
    - Click Count (0)
  8. android/guava-tests/test/com/google/common/cache/CacheExpirationTest.java

                .removalListener(removalListener)
                .ticker(ticker)
                .build(loader);
        runRemovalScheduler(cache, removalListener, loader, ticker, KEY_PREFIX, EXPIRING_TIME);
      }
    
      public void testRemovalScheduler_expireAfterBoth() {
        FakeTicker ticker = new FakeTicker();
        CountingRemovalListener<String, Integer> removalListener = countingRemovalListener();
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 23 16:38:16 GMT 2026
    - 19.1K bytes
    - Click Count (0)
  9. android/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java

    import java.util.concurrent.atomic.AtomicInteger;
    import org.jspecify.annotations.Nullable;
    
    /**
     * Utility {@link RemovalListener} implementations intended for use in testing.
     *
     * @author mike nonemacher
     */
    @GwtCompatible
    final class TestingRemovalListeners {
    
      /** Returns a new no-op {@code RemovalListener}. */
      static <K, V> NullRemovalListener<K, V> nullRemovalListener() {
        return new NullRemovalListener<>();
      }
    
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Feb 23 13:13:59 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  10. android/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++) {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Wed Mar 18 18:06:14 GMT 2026
    - 15K bytes
    - Click Count (0)
Back to Top