|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap
org.norther.tammi.acorn.util.ConcurrentAbstractMap
org.norther.tammi.acorn.util.ConcurrentReadMap
org.norther.tammi.acorn.util.ConcurrentLockMap
public class ConcurrentLockMap
A barrier based extension to the ConcurrentReadMap which works
with jdk version prior to 1.5. In unit tests, it seems to perform slightly
slower than the corresponding volatile implementation.
Based on Doug Lea's ConcurrentReaderHashMap .
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.norther.tammi.acorn.util.ConcurrentAbstractMap |
|---|
ConcurrentAbstractMap.Entry |
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.acorn.util.ConcurrentReadMap |
|---|
DEFAULT_CAPACITY, MAXIMUM_CAPACITY, MINIMUM_CAPACITY |
| Fields inherited from class org.norther.tammi.acorn.util.ConcurrentAbstractMap |
|---|
DEFAULT_LOAD_FACTOR |
| Constructor Summary | |
|---|---|
ConcurrentLockMap()
Constructs a new, empty map with a default capacity and load factor. |
|
ConcurrentLockMap(int capacity)
Constructs a new, empty map with the specified initial capacity and default load factor. |
|
ConcurrentLockMap(int capacity,
float factor)
Constructs a new, empty map with the specified initial capacity and the specified load factor. |
|
ConcurrentLockMap(Map map)
Constructs a new map with the same mappings as the given map. |
|
| Method Summary | |
|---|---|
Object |
clone()
|
protected ConcurrentAbstractMap.Entry[] |
getReadTable()
Gets the internal read table. |
protected ConcurrentAbstractMap.Entry[] |
getWriteTable()
Gets the internal write table. |
protected void |
recordWrite(Object x)
Forces a memory synchronization that will cause all readers to see the table. |
protected void |
setWriteTable(ConcurrentAbstractMap.Entry[] tab)
Sets the internal write table. |
| Methods inherited from class org.norther.tammi.acorn.util.ConcurrentReadMap |
|---|
capacity, clear, containsKey, containsValue, getEntry, getInternal, isEmpty, putAll, putInternal, rehash, removeInternal, replaceInternal, size |
| Methods inherited from class org.norther.tammi.acorn.util.ConcurrentAbstractMap |
|---|
add, capacity, contains, elements, entrySet, get, hash, keys, keySet, put, putIfAbsent, remove, remove, replace, replace, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public ConcurrentLockMap()
public ConcurrentLockMap(int capacity)
Note that the initial capacity will be rounded to the nearest power of two.
capacity - the initial capacity.
IllegalArgumentException - for negative values.
public ConcurrentLockMap(int capacity,
float factor)
Note that the initial capacity will be rounded to the nearest power of two.
capacity - the initial capacity.factor - the load factor of the map.
IllegalArgumentException - for negative values.public ConcurrentLockMap(Map map)
map - the map to copy.| Method Detail |
|---|
public Object clone()
clone in class ConcurrentReadMapprotected ConcurrentAbstractMap.Entry[] getReadTable()
ConcurrentAbstractMap
getReadTable in class ConcurrentReadMapprotected ConcurrentAbstractMap.Entry[] getWriteTable()
ConcurrentAbstractMap
getWriteTable in class ConcurrentReadMapprotected void setWriteTable(ConcurrentAbstractMap.Entry[] tab)
ConcurrentAbstractMap
setWriteTable in class ConcurrentReadMaptab - the write table.protected void recordWrite(Object x)
ConcurrentReadMap
recordWrite in class ConcurrentReadMapx - some object to be made visible.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||