|
Eclipse Platform Kepler (4.3) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.framework.eventmgr.CopyOnWriteIdentityMap<K,V>
public class CopyOnWriteIdentityMap<K,V>
A copy-on-write identity map. Write operations result in copying the underlying data so that simultaneous read operations are not affected. This allows for safe, unsynchronized traversal.
Note: This class uses identity for key and value comparison, not equals.
Constructor Summary | |
---|---|
CopyOnWriteIdentityMap()
Creates an empty map. |
|
CopyOnWriteIdentityMap(CopyOnWriteIdentityMap<? extends K,? extends V> source)
Copy constructor. |
Method Summary | ||
---|---|---|
void |
clear()
Remove all entries from the map. |
|
boolean |
containsKey(java.lang.Object key)
Check if the map contains the specified key. |
|
boolean |
containsValue(java.lang.Object value)
Check if the map contains the specified value. |
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Returns a snapshot of the entries in this map. |
|
V |
get(java.lang.Object key)
Return the value object for the specified key. |
|
boolean |
isEmpty()
Is the map empty? |
|
java.util.Set<K> |
keySet()
Returns a snapshot of the keys in this map. |
|
V |
put(K key,
V value)
Add a key, value pair to the map. |
|
|
putAll(L[] keys)
Add all the keys from the specified array to this map with the value null . |
|
void |
putAll(java.util.Map<? extends K,? extends V> source)
Add all the entries from the specified map to this map. |
|
V |
remove(java.lang.Object key)
Remove a key from the map and returns the value associated with the key. |
|
int |
size()
Return the number of entries in the map. |
|
java.util.Collection<V> |
values()
Returns a snapshot of the values in this map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public CopyOnWriteIdentityMap()
public CopyOnWriteIdentityMap(CopyOnWriteIdentityMap<? extends K,? extends V> source)
source
- The CopyOnWriteMap to copy.Method Detail |
---|
public V put(K key, V value)
put
in interface java.util.Map<K,V>
key
- The key object to be added to the list.value
- The value object to be associated with the key.
This may be null.
null
if the specified key was newly added to the map.
Otherwise the previous value of the key.
java.lang.IllegalArgumentException
- If key is null.public void putAll(java.util.Map<? extends K,? extends V> source)
putAll
in interface java.util.Map<K,V>
source
- The map whose entries are to be added to this map.public <L extends K> void putAll(L[] keys)
null
.
keys
- The array of keys to be added to this map.public V remove(java.lang.Object key)
remove
in interface java.util.Map<K,V>
key
- The key object to be removed from the map.
null
if the key was not in the list.
Otherwise, the value associated with the key.
java.lang.IllegalArgumentException
- If key is null.public void clear()
clear
in interface java.util.Map<K,V>
public boolean isEmpty()
isEmpty
in interface java.util.Map<K,V>
true
if the list is empty.public int size()
size
in interface java.util.Map<K,V>
public V get(java.lang.Object key)
get
in interface java.util.Map<K,V>
key
- The key object.
java.lang.IllegalArgumentException
- If key is null.public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<K,V>
key
- The key object.
true
if the specified key is in the map.
java.lang.IllegalArgumentException
- If key is null.public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<K,V>
value
- The value object.
true
if the specified value is in the map.public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
entrySet
in interface java.util.Map<K,V>
public java.util.Set<K> keySet()
keySet
in interface java.util.Map<K,V>
public java.util.Collection<V> values()
values
in interface java.util.Map<K,V>
|
Eclipse Platform Kepler (4.3) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2012. All rights reserved.