This method is a convenience for testing. Code should call LocalCache#containsValue directly.
(Object value)
| 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) { |
nothing calls this directly
no test coverage detected