Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for RemovalListener (0.17 sec)

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

     *     Object} if any key is acceptable
     * @author Charles Fry
     * @since 10.0
     */
    @GwtCompatible
    @FunctionalInterface
    @ElementTypesAreNonnullByDefault
    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.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jun 15 18:00:07 UTC 2021
    - 2K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/cache/RemovalListener.java

     *     Object} if any key is acceptable
     * @author Charles Fry
     * @since 10.0
     */
    @GwtCompatible
    @ElementTypesAreNonnullByDefault
    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.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jun 15 18:00:07 UTC 2021
    - 2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/cache/TestingRemovalListeners.java

    import java.util.concurrent.atomic.AtomicInteger;
    
    /**
     * Utility {@link RemovalListener} implementations intended for use in testing.
     *
     * @author mike nonemacher
     */
    @GwtCompatible(emulated = true)
    class TestingRemovalListeners {
    
      /** Returns a new no-op {@code RemovalListener}. */
      static <K, V> NullRemovalListener<K, V> nullRemovalListener() {
        return new NullRemovalListener<>();
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 3K bytes
    - Viewed (0)
  4. 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)
  5. guava-tests/test/com/google/common/cache/TestingRemovalListeners.java

    import java.util.concurrent.atomic.AtomicInteger;
    
    /**
     * Utility {@link RemovalListener} implementations intended for use in testing.
     *
     * @author mike nonemacher
     */
    @GwtCompatible(emulated = true)
    class TestingRemovalListeners {
    
      /** Returns a new no-op {@code RemovalListener}. */
      static <K, V> NullRemovalListener<K, V> nullRemovalListener() {
        return new NullRemovalListener<>();
      }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 3K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LocalCache.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) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Feb 27 19:19:19 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  9. 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)
  10. 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();
        assertSame(computed, cache.getUnchecked(key));
        RemovalNotification<Object, Object> notification = listener.remove();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 4.4K bytes
    - Viewed (0)
Back to top