/** * This method is a convenience for testing. Code should call {@link * MapMakerInternalMap#containsValue} directly. */ @VisibleForTesting boolean containsValue(Object value) { try { if (count != 0) { // read-volatile AtomicReferenceArray<E> table = this.table; int length = table.length(); for (int i = 0; i < length; ++i) { for (E e = table.get(i); e != null; e = e.getNext()) { V entryValue = getLiveValue(e); if (entryValue == null) { continue; } if (map.valueEquivalence().equivalent(value, entryValue)) { return true; } } } } return false; } finally { postReadCleanup(); } }
for (int j = 0; j < table.length(); j++) { for (E e = table.get(j); e != null; e = e.getNext()) { V v = segment.getLiveValue(e); if (v != null && valueEquivalence().equivalent(value, v)) { return true;
/** * This method is a convenience for testing. Code should call {@link * MapMakerInternalMap#containsValue} directly. */ @VisibleForTesting boolean containsValue(Object value) { try { if (count != 0) { // read-volatile AtomicReferenceArray<E> table = this.table; int length = table.length(); for (int i = 0; i < length; ++i) { for (E e = table.get(i); e != null; e = e.getNext()) { V entryValue = getLiveValue(e); if (entryValue == null) { continue; } if (map.valueEquivalence().equivalent(value, entryValue)) { return true; } } } } return false; } finally { postReadCleanup(); } }
/** * This method is a convenience for testing. Code should call {@link Segment#getLiveValue} * instead. */ @VisibleForTesting boolean isLive(ReferenceEntry<K, V> entry) { return segmentFor(entry.getHash()).getLiveValue(entry) != null; }
/** * Unsafely returns the value of the given entry if it's still live, or {@code null} otherwise. */ @Nullable V getLiveValueForTesting(InternalEntry<K, V, ?> entry) { return getLiveValue(castForTesting(entry)); }
/** * This method is a convenience for testing. Code should call {@link Segment#getLiveValue} * instead. */ @VisibleForTesting boolean isLive(ReferenceEntry<K, V> entry) { return segmentFor(entry.getHash()).getLiveValue(entry) != null; }
/** * This method is a convenience for testing. Code should call {@link Segment#getLiveValue} * instead. */ @VisibleForTesting boolean isLive(ReferenceEntry<K, V> entry) { return segmentFor(entry.getHash()).getLiveValue(entry) != null; }
/** * Unsafely returns the value of the given entry if it's still live, or {@code null} otherwise. */ @NullableDecl V getLiveValueForTesting(InternalEntry<K, V, ?> entry) { return getLiveValue(castForTesting(entry)); }
/** * This method is a convenience for testing. Code should call {@link Segment#getLiveValue} * instead. */ @VisibleForTesting boolean isLive(ReferenceEntry<K, V> entry) { return segmentFor(entry.getHash()).getLiveValue(entry) != null; }
/** * This method is a convenience for testing. Code should call {@link Segment#getLiveValue} * instead. */ @VisibleForTesting boolean isLive(ReferenceEntry<K, V> entry) { return segmentFor(entry.getHash()).getLiveValue(entry) != null; }
/** * This method is a convenience for testing. Code should call {@link Segment#getLiveValue} * instead. */ @VisibleForTesting boolean isLive(ReferenceEntry<K, V> entry) { return segmentFor(entry.getHash()).getLiveValue(entry) != null; }
try { K key = entry.getKey(); V value = getLiveValue(entry); if (value != null) { nextExternal = new WriteThroughEntry(key, value);
try { K key = entry.getKey(); V value = getLiveValue(entry); if (value != null) { nextExternal = new WriteThroughEntry(key, value);
for (int j = 0; j < table.length(); j++) { for (E e = table.get(j); e != null; e = e.getNext()) { V v = segment.getLiveValue(e); if (v != null && valueEquivalence().equivalent(value, v)) { return true;
/** * This method is a convenience for testing. Code should call {@link * MapMakerInternalMap#containsValue} directly. */ @VisibleForTesting boolean containsValue(Object value) { try { if (count != 0) { // read-volatile AtomicReferenceArray<E> table = this.table; int length = table.length(); for (int i = 0; i < length; ++i) { for (E e = table.get(i); e != null; e = e.getNext()) { V entryValue = getLiveValue(e); if (entryValue == null) { continue; } if (map.valueEquivalence().equivalent(value, entryValue)) { return true; } } } } return false; } finally { postReadCleanup(); } }
for (int j = 0; j < table.length(); j++) { for (E e = table.get(j); e != null; e = e.getNext()) { V v = segment.getLiveValue(e); if (v != null && valueEquivalence().equivalent(value, v)) { return true;
try { K key = entry.getKey(); V value = getLiveValue(entry); if (value != null) { nextExternal = new WriteThroughEntry(key, value);
/** * Unsafely returns the value of the given entry if it's still live, or {@code null} otherwise. */ @NullableDecl V getLiveValueForTesting(InternalEntry<K, V, ?> entry) { return getLiveValue(castForTesting(entry)); }
/** * Unsafely returns the value of the given entry if it's still live, or {@code null} otherwise. */ @NullableDecl V getLiveValueForTesting(InternalEntry<K, V, ?> entry) { return getLiveValue(castForTesting(entry)); }
/** * Unsafely returns the value of the given entry if it's still live, or {@code null} otherwise. */ @Nullable V getLiveValueForTesting(InternalEntry<K, V, ?> entry) { return getLiveValue(castForTesting(entry)); }