|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<String,V>
com.sun.sgs.impl.util.BindingKeyedMapImpl<V>
V - the type for the map's valuespublic class BindingKeyedMapImpl<V>
An implementation of a persistent Map that uses service
bindings in the data service to store key/value pairs. This map does
not permit null keys or values.
Note: This map is parameterized by value type only. A String
is the only valid key type for a BindingKeyedMap.
A value is stored in the data service using its associated key (a
String) as a suffix to the keyPrefix specified during
construction. All values must implement Serializable. If a
value implements Serializable, but does not implement ManagedObject, the value will be wrapped in an instance of ManagedSerializable when storing it in the data service. Note: users of
this map must use this map's APIs to avoid leaking wrappers for
non-managed, serializable objects.
Instances of BindingKeyedMap as well as its associated
iterators are serializable, but not managed, objects.
| Nested Class Summary | |
|---|---|
(package private) static class |
BindingKeyedMapImpl.ValueIterator<V>
An iterator over the values in the tree. |
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
BindingKeyedMapImpl(String keyPrefix)
Constructs an instance with the specified keyPrefix. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all mappings from this map. |
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the specified
value. |
Set<Map.Entry<String,V>> |
entrySet()
|
V |
get(Object key)
Returns the value to which the specified key is mapped, or
null if this map contains no mapping for this key. |
String |
getKeyPrefix()
Returns the key prefix for this map. |
boolean |
isEmpty()
|
Set<String> |
keySet()
|
V |
put(String key,
V value)
Associates the specified value with the specified key in this map. |
boolean |
putOverride(String key,
V value)
Associates the specified key with the specified value,
and returns true if the key was previously mapped. |
V |
remove(Object key)
Removes the mapping for key from this map if it is present,
and returns the value to which the key was previously mapped, or
null if this map contains no mapping for this key. |
boolean |
removeOverride(String key)
Removes the specified key and associated value from the map,
and returns true if the key was previously mapped. |
int |
size()
Returns the number of key-value mappings in this map. |
Collection<V> |
values()
|
| Methods inherited from class java.util.AbstractMap |
|---|
clone, equals, hashCode, putAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode, putAll |
| Constructor Detail |
|---|
BindingKeyedMapImpl(String keyPrefix)
keyPrefix.
keyPrefix - a key prefix
IllegalArgumentException - if keyPrefix is empty| Method Detail |
|---|
public boolean isEmpty()
isEmpty in interface Map<String,V>isEmpty in class AbstractMap<String,V>
public V put(String key,
V value)
value with the specified key in this map. If the map previously contained a mapping for the
key, the previous value is replaced by the specified value.
put in interface BindingKeyedMap<V>put in interface Map<String,V>put in class AbstractMap<String,V>key - a keyvalue - a value
key, or
null if there was no such mappingpublic V get(Object key)
key is mapped, or
null if this map contains no mapping for this key.
get in interface BindingKeyedMap<V>get in interface Map<String,V>get in class AbstractMap<String,V>key - a key
key is mapped, or
null if there is no such mappingpublic boolean containsKey(Object key)
containsKey in interface Map<String,V>containsKey in class AbstractMap<String,V>public boolean containsValue(Object value)
true if this map maps one or more keys to the specified
value. Values that have been removed from the data manager will be
ignored.
containsValue in interface BindingKeyedMap<V>containsValue in interface Map<String,V>containsValue in class AbstractMap<String,V>value - value whose presence in this map is to be tested
true if this map maps one or more keys to the specified
valuepublic V remove(Object key)
key from this map if it is present,
and returns the value to which the key was previously mapped, or
null if this map contains no mapping for this key.
remove in interface BindingKeyedMap<V>remove in interface Map<String,V>remove in class AbstractMap<String,V>key - a key
key was previously
mapped, or null if there is no such mappingpublic void clear()
clear in interface BindingKeyedMap<V>clear in interface Map<String,V>clear in class AbstractMap<String,V>public int size()
size in interface BindingKeyedMap<V>size in interface Map<String,V>size in class AbstractMap<String,V>public Set<Map.Entry<String,V>> entrySet()
entrySet in interface Map<String,V>entrySet in class AbstractMap<String,V>public Set<String> keySet()
keySet in interface Map<String,V>keySet in class AbstractMap<String,V>public Collection<V> values()
values in interface Map<String,V>values in class AbstractMap<String,V>public String getKeyPrefix()
getKeyPrefix in interface BindingKeyedMap<V>
public boolean putOverride(String key,
V value)
key with the specified value,
and returns true if the key was previously mapped. This method
will not throw ObjectNotFoundException if the key was
previously mapped to a ManagedObject that has been removed from
the DataManager.
putOverride in interface BindingKeyedMap<V>key - a keyvalue - a value
true if the key was previously mapped, and false otherwisepublic boolean removeOverride(String key)
key and associated value from the map,
and returns true if the key was previously mapped. This method
will not throw ObjectNotFoundException if the key was
previously mapped to a ManagedObject that has been removed from
the DataManager.
removeOverride in interface BindingKeyedMap<V>key - a key
true if the key was previously mapped, and false otherwise
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||