| java.lang.Object org.apache.mina.util.CopyOnWriteMap
CopyOnWriteMap | public class CopyOnWriteMap implements Map<K, V>,Cloneable(Code) | | A thread-safe version of
Map in which all operations that change the
Map are implemented by making a new copy of the underlying Map.
While the creation of a new Map can be expensive, this class is designed for
cases in which the primary function is to read data from the Map, not to
modify the Map. Therefore the operations that do not cause a change to this
class happen quickly and concurrently.
author: The Apache MINA Project (dev@mina.apache.org) version: $Rev$, $Date$ |
Constructor Summary | |
public | CopyOnWriteMap() Creates a new instance of CopyOnWriteMap. | public | CopyOnWriteMap(int initialCapacity) | public | CopyOnWriteMap(Map<K, V> data) Creates a new instance of CopyOnWriteMap in which the
initial data being held by this map is contained in
the supplied map. |
Method Summary | |
public void | clear() Removes all entries in this map. | public Object | clone() | public boolean | containsKey(Object key) Returns true if this map contains the provided key, otherwise
this method return false. | public boolean | containsValue(Object value) Returns true if this map contains the provided value, otherwise
this method returns false. | public Set<Entry<K, V>> | entrySet() This method will return a read-only
Set . | public V | get(Object key) Returns the value associated with the provided key from this
map. | public boolean | isEmpty() Returns true if this map is empty, otherwise false. | public Set<K> | keySet() This method will return a read-only
Set . | public V | put(K key, V value) Adds the provided key and value to this map. | public void | putAll(Map<? extends K, ? extends V> newData) Inserts all the keys and values contained in the
provided map to this map. | public V | remove(Object key) Removed the value and key from this map based on the
provided key. | public int | size() Returns the number of key/value pairs in this map. | public Collection<V> | values() This method will return a read-only
Collection . |
CopyOnWriteMap | public CopyOnWriteMap()(Code) | | Creates a new instance of CopyOnWriteMap.
|
CopyOnWriteMap | public CopyOnWriteMap(int initialCapacity)(Code) | | Creates a new instance of CopyOnWriteMap with the specified initial size
Parameters: initialCapacity - The initial size of the Map. |
CopyOnWriteMap | public CopyOnWriteMap(Map<K, V> data)(Code) | | Creates a new instance of CopyOnWriteMap in which the
initial data being held by this map is contained in
the supplied map.
Parameters: data - A Map containing the initial contents to be placed intothis class. |
entrySet | public Set<Entry<K, V>> entrySet()(Code) | | This method will return a read-only
Set .
|
keySet | public Set<K> keySet()(Code) | | This method will return a read-only
Set .
|
|
|