Project Wonder 5.0.0.8795

er.extensions.foundation
Class ERXMutableDictionary

java.lang.Object
  extended by com.webobjects.foundation.NSDictionary<K,V>
      extended by com.webobjects.foundation.NSMutableDictionary
          extended by er.extensions.foundation.ERXMutableDictionary
All Implemented Interfaces:
_NSFoundationCollection, NSCoding, NSKeyValueCoding, NSKeyValueCodingAdditions, Serializable, Cloneable, Map
Direct Known Subclasses:
ERXMutableDictionary.ThreadSafeDictionary

public class ERXMutableDictionary
extends NSMutableDictionary
implements Map

Adds Map functionality to NSMutableDictionary and has helpers to en- and decode from database field. ERPrototype name = mutableDictionary

See Also:
Serialized Form

Nested Class Summary
static class ERXMutableDictionary.ThreadSafeDictionary
          Simple thread safe wrapper.
 
Nested classes/interfaces inherited from class com.webobjects.foundation.NSDictionary
NSDictionary._JavaNSDictionaryMapEntry<P,Q>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding
NSCoding._BigDecimalSupport, NSCoding._BigIntegerSupport, NSCoding._BooleanSupport, NSCoding._ByteSupport, NSCoding._CharacterSupport, NSCoding._DateSupport, NSCoding._DoubleSupport, NSCoding._FloatSupport, NSCoding._IntegerSupport, NSCoding._LongSupport, NSCoding._NumberSupport, NSCoding._ShortSupport, NSCoding._StringSupport, NSCoding.Support
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Field Summary
static long serialVersionUID
           
 
Fields inherited from class com.webobjects.foundation.NSMutableDictionary
_CLASS
 
Fields inherited from class com.webobjects.foundation.NSDictionary
_capacity, _count, _deletionLimit, _entrySetCache, _flags, _hashCache, _hashtableBuckets, _keys, _keysCache, _keySetCache, _MAP_ENTRY_CLASS, _NSDictionaryClassHashCode, _NSDictionaryMapEntryHashCode, _objects, _objectsCache, EmptyDictionary
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_KeyPathSeparatorChar, KeyPathSeparator
 
Constructor Summary
ERXMutableDictionary()
           
ERXMutableDictionary(NSDictionary d)
           
 
Method Summary
 NSArray allValues()
           
 Boolean booleanObjectForKey(String key)
           
 void clear()
          Remove all mappings from this map.
 Object clone()
           
 boolean containsKey(Object arg0)
           
 boolean containsValue(Object arg0)
           
 Set entrySet()
           
static NSDictionary fromBlob(NSData d)
           
static NSDictionary fromPropertyList(String plist)
           
 Object get(Object arg0)
           
 boolean isEmpty()
           
 Set keySet()
           
 Object put(Object arg0, Object arg1)
          Associate the value with key in this map.
 void putAll(Map arg0)
          Copy all mappings from m to this map.
 Object remove(Object arg0)
          Remove mapping for key from this map if it is present.
 int size()
           
 String stringObjectForKey(String key)
          return the string value of an object for key
static NSMutableDictionary synchronizedDictionary()
          Returns a new thread-safe mutable dictionary.
static NSDictionary synchronizedDictionary(NSDictionary dict)
          Returns either a thread-safe wrapper for a mutable dictionary, or just returns dict if the dictionary is not mutable.
static NSMutableDictionary synchronizedDictionary(NSMutableDictionary dict)
          Returns a thread-safe mutable wrapper for the given mutable dictionary.
 NSData toBlob()
           
static NSData toBlob(ERXMutableDictionary dict)
           
static NSData toBlob(NSDictionary d)
           
 String toPropertyList()
           
static String toPropertyList(NSDictionary dict)
           
 Collection values()
          Return a collection view of the values contained in this map.
 
Methods inherited from class com.webobjects.foundation.NSMutableDictionary
addEntriesFromDictionary, immutableClone, mutableClone, removeAllObjects, removeObjectForKey, removeObjectsForKeys, setDictionary, setObjectForKey, takeValueForKey
 
Methods inherited from class com.webobjects.foundation.NSDictionary
_clearDeletionsAndCollisions, _ensureCapacity, _initializeDictionary, _shallowHashCode, allKeys, allKeysForObject, classForCoder, count, decodeObject, emptyDictionary, encodeWithCoder, equals, hashCode, hashMap, hashtable, isEqualToDictionary, keyEnumerator, keysNoCopy, objectEnumerator, objectForKey, objectsForKeys, objectsNoCopy, takeValueForKeyPath, toString, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ERXMutableDictionary

public ERXMutableDictionary(NSDictionary d)

ERXMutableDictionary

public ERXMutableDictionary()
Method Detail

toBlob

public static NSData toBlob(NSDictionary d)

toBlob

public static NSData toBlob(ERXMutableDictionary dict)

fromBlob

public static NSDictionary fromBlob(NSData d)

fromPropertyList

public static NSDictionary fromPropertyList(String plist)

toPropertyList

public static String toPropertyList(NSDictionary dict)

toPropertyList

public String toPropertyList()

toBlob

public NSData toBlob()

clone

public Object clone()
Overrides:
clone in class NSMutableDictionary

clear

public void clear()
Description copied from class: com.webobjects.foundation.NSMutableDictionary
Remove all mappings from this map.

Specified by:
clear in interface Map
Overrides:
clear in class NSMutableDictionary

containsKey

public boolean containsKey(Object arg0)
Specified by:
containsKey in interface Map
Overrides:
containsKey in class NSDictionary

containsValue

public boolean containsValue(Object arg0)
Specified by:
containsValue in interface Map
Overrides:
containsValue in class NSDictionary

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
Overrides:
entrySet in class NSDictionary

get

public Object get(Object arg0)
Specified by:
get in interface Map
Overrides:
get in class NSDictionary

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map
Overrides:
isEmpty in class NSDictionary

keySet

public Set keySet()
Specified by:
keySet in interface Map
Overrides:
keySet in class NSDictionary

put

public Object put(Object arg0,
                  Object arg1)
Description copied from class: com.webobjects.foundation.NSMutableDictionary
Associate the value with key in this map. If the map previously contained a mapping for key, the old value will be replaced by value.

Specified by:
put in interface Map
Overrides:
put in class NSMutableDictionary
Parameters:
arg0 - key to associate value with
arg1 - vaue to be associated with key
Returns:
previous value associated with specified key, or null if there was no mapping for key.

putAll

public void putAll(Map arg0)
Description copied from class: com.webobjects.foundation.NSMutableDictionary
Copy all mappings from m to this map.

Specified by:
putAll in interface Map
Overrides:
putAll in class NSMutableDictionary
Parameters:
arg0 - Mappings to be stored in this map.

remove

public Object remove(Object arg0)
Description copied from class: com.webobjects.foundation.NSMutableDictionary
Remove mapping for key from this map if it is present.

Specified by:
remove in interface Map
Overrides:
remove in class NSMutableDictionary
Parameters:
arg0 - key whose mapping is to be removed from the map.
Returns:
previous value associated with key, or null if there was no mapping for key.

size

public int size()
Specified by:
size in interface Map
Overrides:
size in class NSDictionary

values

public Collection values()
Description copied from class: com.webobjects.foundation.NSMutableDictionary
Return a collection view of the values contained in this map.

Specified by:
values in interface Map
Overrides:
values in class NSMutableDictionary

allValues

public NSArray allValues()
Overrides:
allValues in class NSDictionary

stringObjectForKey

public String stringObjectForKey(String key)
return the string value of an object for key

Parameters:
key - the key which is linked to the object
Returns:
if objectForKey return a non null value this method returns the toString value from the object

booleanObjectForKey

public Boolean booleanObjectForKey(String key)
Parameters:
key -

synchronizedDictionary

public static NSMutableDictionary synchronizedDictionary(NSMutableDictionary dict)
Returns a thread-safe mutable wrapper for the given mutable dictionary.

Parameters:
dict - the dictionary to make thread-safe
Returns:
a thread-safe wrapper around the given dictionary

synchronizedDictionary

public static NSMutableDictionary synchronizedDictionary()
Returns a new thread-safe mutable dictionary.

Returns:
a new thread-safe mutable dictionary

synchronizedDictionary

public static NSDictionary synchronizedDictionary(NSDictionary dict)
Returns either a thread-safe wrapper for a mutable dictionary, or just returns dict if the dictionary is not mutable.

Parameters:
dict - the dictionary to make thread-safe
Returns:
a thread-safe dictionary

Last updated: Fri, Jan 9, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.