|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.utils.maps.SyncHashMap<K,V>
K
- V
- public class SyncHashMap<K,V>
THREAD-SAFE unless you misuse getMap()
without locking getReadLock()
or getWriteLock()
according to the operation you want to perform.
Constructor Summary | |
---|---|
SyncHashMap()
|
Method Summary | |
---|---|
V |
get(Object key)
|
Map<K,V> |
getMap()
Use with care ... |
Lock |
getReadLock()
Returns READ LOCK. |
Lock |
getWriteLock()
Returns WRITE LOCK. |
V |
put(K key,
V value)
|
V |
remove(K key)
|
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SyncHashMap()
Method Detail |
---|
public V put(K key, V value)
public V remove(K key)
public V get(Object key)
public int size()
public Map<K,V> getMap()
getReadLock()
and getWriteLock()
.
public Lock getReadLock()
public Lock getWriteLock()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |