MCPcopy Create free account
hub / github.com/antlr/codebuff / maximumSize

Method maximumSize

corpus/java/training/guava/cache/CacheBuilder.java:408–419  ·  view source on GitHub ↗

Specifies the maximum number of entries the cache may contain. Note that the cache may evict an entry before this limit is exceeded . As the cache size grows close to the maximum, the cache evicts entries that are less likely to be used again. For example, the cache may evict an entry because

(long size)

Source from the content-addressed store, hash-verified

406 * @throws IllegalStateException if a maximum size or weight was already set
407 */
408 public CacheBuilder<K, V> maximumSize(long size) {
409 checkState(
410 this.maximumSize == UNSET_INT, "maximum size was already set to %s", this.maximumSize);
411 checkState(
412 this.maximumWeight == UNSET_INT,
413 "maximum weight was already set to %s",
414 this.maximumWeight);
415 checkState(this.weigher == null, "maximum size can not be combined with weigher");
416 checkArgument(size >= 0, "maximum size must not be negative");
417 this.maximumSize = size;
418 return this;
419 }
420
421 /**
422 * Specifies the maximum weight of entries the cache may contain. Weight is determined using the

Callers 2

toCacheBuilderMethod · 0.45
recreateCacheBuilderMethod · 0.45

Calls 2

checkStateMethod · 0.45
checkArgumentMethod · 0.45

Tested by

no test coverage detected