Package org.multiverse.collections
Class AbstractTxnMap<K,V>
- java.lang.Object
-
- org.multiverse.collections.AbstractTxnMap<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
,TxnMap<K,V>
- Direct Known Subclasses:
NaiveTxnHashMap
public abstract class AbstractTxnMap<K,V> extends java.lang.Object implements TxnMap<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected TxnRefFactory
defaultRefFactory
protected Stm
stm
-
Constructor Summary
Constructors Constructor Description AbstractTxnMap(Stm stm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
TxnSet<java.util.Map.Entry<K,V>>
entrySet()
Returns aTxnSet
view of the mappings contained in this map.V
get(java.lang.Object key)
Stm
getStm()
boolean
isEmpty()
boolean
isEmpty(Txn tx)
Returns true if this map contains no key-value mappings.TxnSet<K>
keySet()
Returns aTxnSet
view of the keys contained in this map.V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> m)
void
putAll(Txn tx, java.util.Map<? extends K,? extends V> m)
Copies all of the mappings from the specified map to this map (optional operation).V
remove(java.lang.Object key)
int
size()
java.lang.String
toString()
TxnCollection<V>
values()
Returns aTxnCollection
view of the values contained in this map.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
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:TxnMap
Returns true if this map contains no key-value mappings.
-
keySet
public TxnSet<K> keySet()
Description copied from interface:TxnMap
Returns aTxnSet
view 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(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
putAll
public void putAll(Txn tx, java.util.Map<? extends K,? extends V> m)
Description copied from interface:TxnMap
Copies 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:TxnMap
Returns aTxnCollection
view 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<java.util.Map.Entry<K,V>> entrySet()
Description copied from interface:TxnMap
Returns aTxnSet
view 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.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-