com.faunos.util
Class CopyOnWriteMap<K,V>
java.lang.Object
com.faunos.util.AbstractCopyOnWriteMap<K,V,Map<K,V>>
com.faunos.util.CopyOnWriteMap<K,V>
- All Implemented Interfaces:
- Cloneable, Map<K,V>
public class CopyOnWriteMap<K,V>
- extends AbstractCopyOnWriteMap<K,V,Map<K,V>>
- implements Cloneable
A copy-on-write Map implementation using a backing
java.util.HashMap.
- Author:
- Babak Farhang
- See Also:
AbstractCopyOnWriteMap
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from class com.faunos.util.AbstractCopyOnWriteMap |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, setMap, size, values |
CopyOnWriteMap
public CopyOnWriteMap()
- Default constructor creates an empty map.
CopyOnWriteMap
public CopyOnWriteMap(CopyOnWriteMap<K,V> copy)
- Copy constructor. This makes a shallow copy. Note this class is
also Cloneable.
- Throws:
NullPointerException
- if copy is null.
emptyMap
protected final Map<K,V> emptyMap()
- Description copied from class:
AbstractCopyOnWriteMap
- Returns an implementation-specific empty map. The returned map
may be read-only. An implementation ought to return the same
empty instance across all instances of its class.
- Specified by:
emptyMap
in class AbstractCopyOnWriteMap<K,V,Map<K,V>>
newMap
protected Map<K,V> newMap()
- Returns a new HashMap.
- Specified by:
newMap
in class AbstractCopyOnWriteMap<K,V,Map<K,V>>