org.cometd.util
Class ImmutableHashMap.Mutable
java.lang.Object
java.util.AbstractMap<K,V>
org.cometd.util.ImmutableHashMap.Mutable
- All Implemented Interfaces:
- Map<K,V>
- Enclosing class:
- ImmutableHashMap<K,V>
public class ImmutableHashMap.Mutable
- extends AbstractMap<K,V>
- implements Map<K,V>
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
ImmutableHashMap.Mutable
public ImmutableHashMap.Mutable()
asImmutable
public ImmutableHashMap<K,V> asImmutable()
entrySet
public Set<Map.Entry<K,V>> entrySet()
- Specified by:
entrySet in interface Map<K,V>- Specified by:
entrySet in class AbstractMap<K,V>
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey in interface Map<K,V>- Overrides:
containsKey in class AbstractMap<K,V>
get
public V get(Object key)
- Specified by:
get in interface Map<K,V>- Overrides:
get in class AbstractMap<K,V>
getEntry
public Map.Entry<K,V> getEntry(K key)
- Get an entry reference.
- Parameters:
key - The key to lookup.
- Returns:
- The found entry
getEntryReference
public ImmutableHashMap.MutableEntry<K,V> getEntryReference(K key)
throws IllegalStateException
- Get an entry reference.
The entries stored in the top level of the maps entry buckets
are never deleted, only nulled. Thus references returned to them
can be kept over calls to reset and used to directly access the
value without a hash lookup.
This method returns only such top level entries, or null if one
cannot be created. Entries that do not exist are created with
null values.
- Parameters:
key - The key to lookup.
- Returns:
- The found entry
- Throws:
IllegalStateException - if key is not a top level entry.
put
public V put(K key,
V value)
- Specified by:
put in interface Map<K,V>- Overrides:
put in class AbstractMap<K,V>
clear
public void clear()
- Specified by:
clear in interface Map<K,V>- Overrides:
clear in class AbstractMap<K,V>
remove
public V remove(Object key)
- Specified by:
remove in interface Map<K,V>- Overrides:
remove in class AbstractMap<K,V>
size
public int size()
- Specified by:
size in interface Map<K,V>- Overrides:
size in class AbstractMap<K,V>
Copyright © 2008-2010 Dojo Foundation. All Rights Reserved.