Class WeakKeyValueMap<K,V>

java.lang.Object
jadex.collection.WeakKeyValueMap<K,V>
All Implemented Interfaces:
Map<K,V>

public class WeakKeyValueMap<K,V> extends Object implements Map<K,V>
HashMap with weak reference on both sides.
  • Field Details

  • Constructor Details

    • WeakKeyValueMap

      public WeakKeyValueMap()
    • WeakKeyValueMap

      public WeakKeyValueMap(Map<? extends K,? extends V> m)
  • Method Details

    • size

      public int size()
      Returns the size of the map.
      Specified by:
      size in interface Map<K,V>
    • isEmpty

      public boolean isEmpty()
      Returns if empty.
      Specified by:
      isEmpty in interface Map<K,V>
    • containsKey

      public boolean containsKey(Object key)
      Returns if key is contained.
      Specified by:
      containsKey in interface Map<K,V>
    • containsValue

      public boolean containsValue(Object value)
      Returns if value is contained.
      Specified by:
      containsValue in interface Map<K,V>
    • get

      public V get(Object key)
      Gets the value for key.
      Specified by:
      get in interface Map<K,V>
    • put

      public V put(K key, V value)
      Adds value for key.
      Specified by:
      put in interface Map<K,V>
    • remove

      public V remove(Object key)
      Removes key.
      Specified by:
      remove in interface Map<K,V>
    • putAll

      public void putAll(Map<? extends K,? extends V> m)
      Adds other map content.
      Specified by:
      putAll in interface Map<K,V>
    • clear

      public void clear()
      Clears map.
      Specified by:
      clear in interface Map<K,V>
    • keySet

      public Set<K> keySet()
      Returns the key set.
      Specified by:
      keySet in interface Map<K,V>
    • values

      public Collection<V> values()
      Returns the values.
      Specified by:
      values in interface Map<K,V>
    • entrySet

      public Set<Map.Entry<K,V>> entrySet()
      Returns the entry set.
      Specified by:
      entrySet in interface Map<K,V>