Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 9,184 for weigher (0.35 sec)

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

    @ElementTypesAreNonnullByDefault
    public interface Weigher<K, V> {
    
      /**
       * Returns the weight of a cache entry. There is no unit for entry weights; rather they are simply
       * relative to each other.
       *
       * @return the weight of the entry; must be non-negative
       */
      int weigh(K key, V value);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jun 15 18:00:07 GMT 2021
    - 1.1K bytes
    - Viewed (0)
  2. guava/src/com/google/common/cache/Weigher.java

    @FunctionalInterface
    @ElementTypesAreNonnullByDefault
    public interface Weigher<K, V> {
    
      /**
       * Returns the weight of a cache entry. There is no unit for entry weights; rather they are simply
       * relative to each other.
       *
       * @return the weight of the entry; must be non-negative
       */
      int weigh(K key, V value);
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Tue Jun 15 18:00:07 GMT 2021
    - 1.1K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/cache/TestingWeighers.java

      static Weigher<Object, Object> constantWeigher(int constant) {
        return new ConstantWeigher(constant);
      }
    
      /** Returns a {@link Weigher} that uses the integer key as the weight. */
      static Weigher<Integer, Object> intKeyWeigher() {
        return new IntKeyWeigher();
      }
    
      /** Returns a {@link Weigher} that uses the integer value as the weight. */
      static Weigher<Object, Integer> intValueWeigher() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 1.9K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/cache/CacheEvictionTest.java

      }
    
      public void testEviction_weightedLru() {
        // test weighted lru within a single segment
        IdentityLoader<Integer> loader = identityLoader();
        LoadingCache<Integer, Integer> cache =
            CacheBuilder.newBuilder()
                .concurrencyLevel(1)
                .maximumWeight(45)
                .weigher(intKeyWeigher())
                .build(loader);
        CacheTesting.warmUp(cache, 0, 10);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 14.9K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/cache/TestingWeighers.java

      static Weigher<Object, Object> constantWeigher(int constant) {
        return new ConstantWeigher(constant);
      }
    
      /** Returns a {@link Weigher} that uses the integer key as the weight. */
      static Weigher<Integer, Object> intKeyWeigher() {
        return new IntKeyWeigher();
      }
    
      /** Returns a {@link Weigher} that uses the integer value as the weight. */
      static Weigher<Object, Integer> intValueWeigher() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 1.9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/cache/CacheEvictionTest.java

      }
    
      public void testEviction_weightedLru() {
        // test weighted lru within a single segment
        IdentityLoader<Integer> loader = identityLoader();
        LoadingCache<Integer, Integer> cache =
            CacheBuilder.newBuilder()
                .concurrencyLevel(1)
                .maximumWeight(45)
                .weigher(intKeyWeigher())
                .build(loader);
        CacheTesting.warmUp(cache, 0, 10);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 14.9K bytes
    - Viewed (0)
  7. guava/src/com/google/common/cache/CacheBuilder.java

        checkArgument(maximumSize >= 0, "maximum size must not be negative");
        this.maximumSize = maximumSize;
        return this;
      }
    
      /**
       * Specifies the maximum weight of entries the cache may contain. Weight is determined using the
       * {@link Weigher} specified with {@link #weigher}, and use of this method requires a
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 51.3K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/cache/CacheBuilder.java

        checkArgument(maximumSize >= 0, "maximum size must not be negative");
        this.maximumSize = maximumSize;
        return this;
      }
    
      /**
       * Specifies the maximum weight of entries the cache may contain. Weight is determined using the
       * {@link Weigher} specified with {@link #weigher}, and use of this method requires a
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 44.8K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/cache/CacheBuilderTest.java

      }
    
      @GwtIncompatible // weigher
      public void testWeigher_withoutMaximumWeight() {
        CacheBuilder<Object, Object> builder = CacheBuilder.newBuilder().weigher(constantWeigher(42));
        assertThrows(IllegalStateException.class, () -> builder.build(identityLoader()));
      }
    
      @GwtIncompatible // weigher
      public void testWeigher_withMaximumSize() {
        assertThrows(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 23.2K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java

        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);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 19.2K bytes
    - Viewed (0)
Back to top