Package org.multiverse.collections
Class AbstractTxnMap<K,V>
- java.lang.Object
-
- org.multiverse.collections.AbstractTxnMap<K,V>
-
- Direct Known Subclasses:
NaiveTxnHashMap
public abstract class AbstractTxnMap<K,V> extends Object implements TxnMap<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected TxnRefFactorydefaultRefFactoryprotected Stmstm
-
Constructor Summary
Constructors Constructor Description AbstractTxnMap(Stm stm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)TxnSet<Map.Entry<K,V>>entrySet()Returns aTxnSetview of the mappings contained in this map.Vget(Object key)StmgetStm()booleanisEmpty()booleanisEmpty(Txn tx)Returns true if this map contains no key-value mappings.TxnSet<K>keySet()Returns aTxnSetview of the keys contained in this map.Vput(K key, V value)voidputAll(Map<? extends K,? extends V> m)voidputAll(Txn tx, Map<? extends K,? extends V> m)Copies all of the mappings from the specified map to this map (optional operation).Vremove(Object key)intsize()StringtoString()TxnCollection<V>values()Returns aTxnCollectionview of the values contained in this map.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
stm
protected final Stm stm
-
defaultRefFactory
protected final TxnRefFactory defaultRefFactory
-
-
Constructor Detail
-
AbstractTxnMap
public AbstractTxnMap(Stm stm)
-
-
Method Detail
-
isEmpty
public boolean isEmpty(Txn tx)
Description copied from interface:TxnMapReturns true if this map contains no key-value mappings.
-
keySet
public TxnSet<K> keySet()
Description copied from interface:TxnMapReturns aTxnSetview of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>
-
putAll
public void putAll(Txn tx, Map<? extends K,? extends V> m)
Description copied from interface:TxnMapCopies all of the mappings from the specified map to this map (optional operation). The effect of this call is equivalent to that of callingput(k, v)on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress.
-
values
public TxnCollection<V> values()
Description copied from interface:TxnMapReturns aTxnCollectionview of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.
-
entrySet
public TxnSet<Map.Entry<K,V>> entrySet()
Description copied from interface:TxnMapReturns aTxnSetview of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.
-
-