|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.osgi.framework.eventmgr.CopyOnWriteIdentityMap
public class CopyOnWriteIdentityMap
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 source)
Copy constructor. |
Method Summary | |
---|---|
void |
clear()
Remove all entries from the map. |
boolean |
containsKey(Object key)
Check if the map contains the specified key. |
boolean |
containsValue(Object value)
Check if the map contains the specified value. |
Set |
entrySet()
Returns a snapshot of the entries in this map. |
Object |
get(Object key)
Return the value object for the specified key. |
boolean |
isEmpty()
Is the map empty? |
Set |
keySet()
Returns a snapshot of the keys in this map. |
Object |
put(Object key,
Object value)
Add a key, value pair to the map. |
void |
putAll(Map source)
Add all the entries from the specified map to this map. |
void |
putAll(Object[] keys)
Add all the keys from the specified array to this map with the value null . |
Object |
remove(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. |
Collection |
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 source)
source
- The CopyOnWriteMap to copy.Method Detail |
---|
public Object put(Object key, Object value)
put
in interface Map
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.
IllegalArgumentException
- If key is null.public void putAll(Map source)
putAll
in interface Map
source
- The map whose entries are to be added to this map.public void putAll(Object[] keys)
null
.
keys
- The array of keys to be added to this map.public Object remove(Object key)
remove
in interface Map
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.
IllegalArgumentException
- If key is null.public void clear()
clear
in interface Map
public boolean isEmpty()
isEmpty
in interface Map
true
if the list is empty.public int size()
size
in interface Map
public Object get(Object key)
get
in interface Map
key
- The key object.
IllegalArgumentException
- If key is null.public boolean containsKey(Object key)
containsKey
in interface Map
key
- The key object.
true
if the specified key is in the map.
IllegalArgumentException
- If key is null.public boolean containsValue(Object value)
containsValue
in interface Map
value
- The value object.
true
if the specified value is in the map.public Set entrySet()
entrySet
in interface Map
public Set keySet()
keySet
in interface Map
public Collection values()
values
in interface Map
|
Eclipse Platform Release 3.6 |
|||||||||
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, 2010. All rights reserved.