K - The type of the keys.V - The type of the values.public class RWLockedMap<K,V> extends Object implements Map<K,V>
Map implementation that uses ReadWriteLock in its functions. Beware that this
class does not override the functions introduced in Java 8 as this class was designed to be used
internally within Managed Map project.| Modifier and Type | Field and Description |
|---|---|
protected ReadWriteLock |
rwLock |
protected Map<K,V> |
wrapped |
| Constructor and Description |
|---|
RWLockedMap(Map<K,V> wrapped) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
protected void |
doInLock(Lock lock,
Runnable action)
Does a specific action within the scope of a lock.
|
protected <R> R |
doInLock(Lock lock,
java.util.function.Supplier<R> action)
Does a specific action within the scope of a lock.
|
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
ReadWriteLock |
getReadWriteLock() |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllprotected final ReadWriteLock rwLock
public boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>protected void doInLock(Lock lock, Runnable action)
lock - The locker object.action - The action that should run.protected <R> R doInLock(Lock lock, java.util.function.Supplier<R> action)
lock - The locker object.action - The action that should run.public ReadWriteLock getReadWriteLock()
Copyright © 2011–2015 Everit Kft.. All rights reserved.