org.webmacro.util
Class ScalableIdentityMap

java.lang.Object
  extended byorg.webmacro.util.AbstractScalableMap
      extended byorg.webmacro.util.ScalableIdentityMap
All Implemented Interfaces:
SimpleMap

public final class ScalableIdentityMap
extends AbstractScalableMap

Reduce locking overhead for a map with few writers and many readers. Writes are five times more expensive than a SimpleMap, reads cost only slightly more. However, five readers can access the same value simultaneously, without blocking.
This class uses SimpleIdentityMap as its implementation. See description of SimpleIdentity for behaviour of this map.


Field Summary
static int DEFAULT_SIZE
           
 
Fields inherited from class org.webmacro.util.AbstractScalableMap
DEFAULT_FACTOR
 
Constructor Summary
ScalableIdentityMap()
           
ScalableIdentityMap(int size)
           
ScalableIdentityMap(int factor, int size)
           
 
Methods inherited from class org.webmacro.util.AbstractScalableMap
clear, get, put, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SIZE

public static final int DEFAULT_SIZE
See Also:
Constant Field Values
Constructor Detail

ScalableIdentityMap

public ScalableIdentityMap(int factor,
                           int size)

ScalableIdentityMap

public ScalableIdentityMap(int size)

ScalableIdentityMap

public ScalableIdentityMap()