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

Method containsValue

output/java_guava/1.4.19/LocalCache.java:2892–2915  ·  view source on GitHub ↗

This method is a convenience for testing. Code should call LocalCache#containsValue directly.

(Object value)

Source from the content-addressed store, hash-verified

2890 */
2891
2892 @VisibleForTesting
2893 boolean containsValue(Object value) {
2894 try {
2895 if (count != 0) { // read-volatile
2896 long now = map.ticker.read();
2897 AtomicReferenceArray<ReferenceEntry<K, V>> table = this.table;
2898 int length = table.length();
2899 for (int i = 0; i < length; ++i) {
2900 for (ReferenceEntry<K, V> e = table.get(i); e != null; e = e.getNext()) {
2901 V entryValue = getLiveValue(e, now);
2902 if (entryValue == null) {
2903 continue;
2904 }
2905 if (map.valueEquivalence.equivalent(value, entryValue)) {
2906 return true;
2907 }
2908 }
2909 }
2910 }
2911 return false;
2912 } finally {
2913 postReadCleanup();
2914 }
2915 }
2916
2917 @Nullable
2918 V put(K key, int hash, V value, boolean onlyIfAbsent) {

Callers

nothing calls this directly

Calls 7

getLiveValueMethod · 0.95
postReadCleanupMethod · 0.95
getMethod · 0.65
getNextMethod · 0.65
readMethod · 0.45
lengthMethod · 0.45
equivalentMethod · 0.45

Tested by

no test coverage detected