Class WeakConcurrentMap.WithInlinedExpunction<K,​V>

  • All Implemented Interfaces:
    java.lang.Iterable<java.util.Map.Entry<K,​V>>, java.lang.Runnable
    Enclosing class:
    WeakConcurrentMap<K,​V>

    public static class WeakConcurrentMap.WithInlinedExpunction<K,​V>
    extends WeakConcurrentMap<K,​V>
    A WeakConcurrentMap where stale entries are removed as a side effect of interacting with this map.
    • Constructor Detail

      • WithInlinedExpunction

        public WithInlinedExpunction()
    • Method Detail

      • get

        public V get​(K key)
        Overrides:
        get in class WeakConcurrentMap<K,​V>
        Parameters:
        key - The key of the entry.
        Returns:
        The value of the entry or the default value if it did not exist.
      • containsKey

        public boolean containsKey​(K key)
        Overrides:
        containsKey in class WeakConcurrentMap<K,​V>
        Parameters:
        key - The key of the entry.
        Returns:
        true if the key already defines a value.
      • put

        public V put​(K key,
                     V value)
        Overrides:
        put in class WeakConcurrentMap<K,​V>
        Parameters:
        key - The key of the entry.
        value - The value of the entry.
        Returns:
        The previous entry or null if it does not exist.
      • remove

        public V remove​(K key)
        Overrides:
        remove in class WeakConcurrentMap<K,​V>
        Parameters:
        key - The key of the entry.
        Returns:
        The removed entry or null if it does not exist.
      • iterator

        public java.util.Iterator<java.util.Map.Entry<K,​V>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<K>
        Overrides:
        iterator in class WeakConcurrentMap<K,​V>
      • approximateSize

        public int approximateSize()
        Description copied from class: WeakConcurrentMap
        Returns the approximate size of this map where the returned number is at least as big as the actual number of entries.
        Overrides:
        approximateSize in class WeakConcurrentMap<K,​V>
        Returns:
        The minimum size of this map.