org.webmacro.util
Class ScalableMap

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

public final class ScalableMap
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 implementation uses SimpleHashMaps as its map implementation.


Field Summary
static int DEFAULT_SIZE
           
 
Fields inherited from class org.webmacro.util.AbstractScalableMap
DEFAULT_FACTOR
 
Constructor Summary
ScalableMap()
           
ScalableMap(int size)
           
ScalableMap(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

ScalableMap

public ScalableMap(int factor,
                   int size)

ScalableMap

public ScalableMap(int size)

ScalableMap

public ScalableMap()