Class ConcurrentReferenceHashMap.WriteThroughEntry

  • All Implemented Interfaces:
    java.io.Serializable, java.util.Map.Entry<K,​V>
    Enclosing class:
    ConcurrentReferenceHashMap<K,​V>

    final class ConcurrentReferenceHashMap.WriteThroughEntry
    extends ConcurrentReferenceHashMap.SimpleEntry<K,​V>
    Custom Entry class used by EntryIterator.next(), that relays setValue changes to the underlying map.
    • Constructor Detail

      • WriteThroughEntry

        WriteThroughEntry​(K k,
                          V v)
    • Method Detail

      • setValue

        public V setValue​(V value)
        Set our entry's value and write through to the map. The value to return is somewhat arbitrary here. Since a WriteThroughEntry does not necessarily track asynchronous changes, the most recent "previous" value could be different from what we return (or could even have been removed in which case the put will re-establish). We do not and cannot guarantee more.
        Specified by:
        setValue in interface java.util.Map.Entry<K,​V>
        Overrides:
        setValue in class ConcurrentReferenceHashMap.SimpleEntry<K,​V>