MCPcopy
hub / github.com/google/guava / setValue

Method setValue

guava/src/com/google/common/cache/LocalCache.java:2032–2043  ·  view source on GitHub ↗

Sets a new value of an entry. Adds newly created entries at the end of the access queue.

(ReferenceEntry<K, V> entry, K key, V value, long now)

Source from the content-addressed store, hash-verified

2030
2031 /** Sets a new value of an entry. Adds newly created entries at the end of the access queue. */
2032 @GuardedBy("this")
2033 void setValue(ReferenceEntry<K, V> entry, K key, V value, long now) {
2034 ValueReference<K, V> previous = entry.getValueReference();
2035 int weight = map.weigher.weigh(key, value);
2036 checkState(weight >= 0, "Weights must be non-negative");
2037
2038 ValueReference<K, V> valueReference =
2039 map.valueStrength.referenceValue(this, entry, value, weight);
2040 entry.setValueReference(valueReference);
2041 recordWrite(entry, weight, now);
2042 previous.notifyNewValue(value);
2043 }
2044
2045 // loading
2046

Callers 3

putMethod · 0.95
replaceMethod · 0.95
storeLoadedValueMethod · 0.95

Calls 7

recordWriteMethod · 0.95
getValueReferenceMethod · 0.65
weighMethod · 0.65
setValueReferenceMethod · 0.65
notifyNewValueMethod · 0.65
checkStateMethod · 0.45
referenceValueMethod · 0.45

Tested by

no test coverage detected