Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 53 for weight (0.29 sec)

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

        assertThat(keySet).containsExactly(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
    
        // add an at-the-maximum-weight entry
        getAll(cache, asList(45));
        CacheTesting.drainRecencyQueues(cache);
        assertThat(keySet).containsExactly(0, 45);
    
        // add an over-the-maximum-weight entry
        getAll(cache, asList(46));
        CacheTesting.drainRecencyQueues(cache);
        assertThat(keySet).contains(0);
      }
    
    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)
  2. guava/src/com/google/common/cache/Weigher.java

    /**
     * Calculates the weights of cache entries.
     *
     * @author Charles Fry
     * @since 11.0
     */
    @GwtCompatible
    @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
       */
    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

        @Override
        public int weigh(Object key, Object value) {
          return constant;
        }
      }
    
      static final class IntKeyWeigher implements Weigher<Integer, Object> {
        @Override
        public int weigh(Integer key, Object value) {
          return key;
        }
      }
    
      static final class IntValueWeigher implements Weigher<Object, Integer> {
        @Override
        public int weigh(Object key, Integer value) {
          return value;
        }
    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/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)
  5. 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)
  6. android/guava/src/com/google/common/cache/LocalCache.java

          ValueReference<K, V> previous = entry.getValueReference();
          int weight = map.weigher.weigh(key, value);
          checkState(weight >= 0, "Weights must be non-negative");
    
          ValueReference<K, V> valueReference =
              map.valueStrength.referenceValue(this, entry, value, weight);
          entry.setValueReference(valueReference);
          recordWrite(entry, weight, now);
          previous.notifyNewValue(value);
        }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 144.7K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/cache/Weigher.java

    /**
     * Calculates the weights of cache entries.
     *
     * @author Charles Fry
     * @since 11.0
     */
    @GwtCompatible
    @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
       */
    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)
  8. .github/ISSUE_TEMPLATE/feature_addition_request.yaml

            a full-time Guava team member. [Feedback](https://stackoverflow.com/a/4543114) from our
            users indicates that they really appreciate Guava's high power-to-weight ratio. It's
            important to us to keep Guava as easy to use and understand as we can. That means boiling
            features down to compact but powerful abstractions, and controlling feature bloat carefully.
    
    
    Others
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Nov 17 18:47:47 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/cache/CacheBuilderSpec.java

              spec.maximumWeight == null, "maximum weight was already set to %s", spec.maximumWeight);
          spec.maximumSize = value;
        }
      }
    
      /** Parse maximumWeight */
      static class MaximumWeightParser extends LongParser {
        @Override
        protected void parseLong(CacheBuilderSpec spec, long value) {
          checkArgument(
              spec.maximumWeight == null, "maximum weight was already set to %s", spec.maximumWeight);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Aug 22 14:27:44 GMT 2022
    - 18.1K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/cache/CacheEvictionTest.java

        assertThat(keySet).containsExactly(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
    
        // add an at-the-maximum-weight entry
        getAll(cache, asList(45));
        CacheTesting.drainRecencyQueues(cache);
        assertThat(keySet).containsExactly(0, 45);
    
        // add an over-the-maximum-weight entry
        getAll(cache, asList(46));
        CacheTesting.drainRecencyQueues(cache);
        assertThat(keySet).contains(0);
      }
    
    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)
Back to top