Package jadex.commons.collection
Class RwMapWrapper<K,V>
- java.lang.Object
- 
- jadex.commons.collection.RwMapWrapper<K,V>
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.Map<K,V>mapThe wrapped map.protected RwAutoLockrwautolock
 - 
Constructor SummaryConstructors Constructor Description RwMapWrapper(java.util.Map<K,V> map)Creates the wrapper.RwMapWrapper(java.util.Map<K,V> map, boolean fair)Creates the wrapper.RwMapWrapper(java.util.Map<K,V> map, java.util.concurrent.locks.ReadWriteLock lock)Creates the wrapper with a specific internal lock.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the map.booleancontainsKey(java.lang.Object key)Returns if the map contains a key.booleancontainsValue(java.lang.Object value)Returns if the map contains a value.java.util.Set<java.util.Map.Entry<K,V>>entrySet()Returns the entry set.Vget(java.lang.Object key)Gets the value for the key.java.util.concurrent.locks.ReadWriteLockgetLock()Gets the internal lock.java.util.concurrent.locks.LockgetReadLock()Gets the read lock for manual locking.java.util.concurrent.locks.LockgetWriteLock()Gets the write lock for manual locking.booleanisEmpty()Returns if map is empty.java.util.Set<K>keySet()Returns the key set.Vput(K key, V value)Puts a key-value pair.voidputAll(java.util.Map<? extends K,? extends V> m)Puts all key-value pairs into map.IAutoLockreadLock()Locks the read lock for resource-based locking.Vremove(java.lang.Object key)Removes a key-value pair.intsize()Returns the size of the map.java.util.Collection<V>values()Returns the key values.IAutoLockwriteLock()Locks the write lock for resource-based locking.
 
- 
- 
- 
Field Detail- 
rwautolockprotected RwAutoLock rwautolock 
 
- 
 - 
Constructor Detail- 
RwMapWrapperpublic RwMapWrapper(java.util.Map<K,V> map) Creates the wrapper.- Parameters:
- map- The wrapped map.
 
 - 
RwMapWrapperpublic RwMapWrapper(java.util.Map<K,V> map, java.util.concurrent.locks.ReadWriteLock lock) Creates the wrapper with a specific internal lock.- Parameters:
- map- The wrapped map.
 
 
- 
 - 
Method Detail- 
sizepublic int size() Returns the size of the map.
 - 
isEmptypublic boolean isEmpty() Returns if map is empty.
 - 
containsKeypublic boolean containsKey(java.lang.Object key) Returns if the map contains a key.
 - 
containsValuepublic boolean containsValue(java.lang.Object value) Returns if the map contains a value.
 - 
getpublic V get(java.lang.Object key) Gets the value for the key.
 - 
removepublic V remove(java.lang.Object key) Removes a key-value pair.
 - 
putAllpublic void putAll(java.util.Map<? extends K,? extends V> m) Puts all key-value pairs into map.
 - 
keySetpublic java.util.Set<K> keySet() Returns the key set. Warning: Use manual locking.
 - 
valuespublic java.util.Collection<V> values() Returns the key values. Warning: Use manual locking.
 - 
entrySetpublic java.util.Set<java.util.Map.Entry<K,V>> entrySet() Returns the entry set. Warning: Use manual locking.
 - 
readLockpublic IAutoLock readLock() Locks the read lock for resource-based locking.
 - 
writeLockpublic IAutoLock writeLock() Locks the write lock for resource-based locking.
 - 
getReadLockpublic java.util.concurrent.locks.Lock getReadLock() Gets the read lock for manual locking.- Specified by:
- getReadLockin interface- IRwMap<K,V>
 
 - 
getWriteLockpublic java.util.concurrent.locks.Lock getWriteLock() Gets the write lock for manual locking.- Specified by:
- getWriteLockin interface- IRwMap<K,V>
 
 
- 
 
-