Interface XAddGetMap<K,​V>

All Superinterfaces:
CapacityCarrying, CapacityExtendable, Copyable, ExtendedCollection<KeyValue<K,​V>>, ExtendedMap<K,​V>, Iterable<KeyValue<K,​V>>, Sized, XAddingMap<K,​V>, XGettingCollection<KeyValue<K,​V>>, XGettingMap<K,​V>, XGettingSet<KeyValue<K,​V>>, XIterable<KeyValue<K,​V>>, XJoinable<KeyValue<K,​V>>
All Known Subinterfaces:
XBasicTable<K,​V>, XChart<K,​V>, XMap<K,​V>, XPutGetMap<K,​V>, XTable<K,​V>
All Known Implementing Classes:
EqHashTable, HashTable, LockedMap

public interface XAddGetMap<K,​V>
extends XAddingMap<K,​V>, XGettingMap<K,​V>
  • Method Details

    • addGet

      KeyValue<K,​V> addGet​(K key, V value)
    • substitute

      KeyValue<K,​V> substitute​(K key, V value)
    • ensure

      V ensure​(K key, Function<? super K,​V> valueProvider)
      Ensures that this map instance contains a non-null value for the passed key and returns that value.

      If a non-null value can be found for the passed key, it is returned. Otherwise, the value provided by the passed supplier will be associated with the passed key and is returned.

      Parameters:
      key - the search key.
      valueProvider - the value supplier used to provide a value for the passed key in case non could be found.
      Returns:
      the value associated with the passed key, either already existing or newly assiciated by the call of this method.