Project Wonder 5.0

er.extensions.foundation
Class ERXMutableDictionary<K,V>

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

public class ERXMutableDictionary<K,V>
extends com.webobjects.foundation.NSMutableDictionary<K,V>

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<K,V>
          Simple thread safe wrapper.
 
Nested classes/interfaces inherited from class com.webobjects.foundation.NSDictionary
com.webobjects.foundation.NSDictionary._JavaNSDictionaryMapEntry<P,Q>
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSCoding
com.webobjects.foundation.NSCoding._BigDecimalSupport, com.webobjects.foundation.NSCoding._BigIntegerSupport, com.webobjects.foundation.NSCoding._BooleanSupport, com.webobjects.foundation.NSCoding._ByteSupport, com.webobjects.foundation.NSCoding._CharacterSupport, com.webobjects.foundation.NSCoding._DateSupport, com.webobjects.foundation.NSCoding._DoubleSupport, com.webobjects.foundation.NSCoding._FloatSupport, com.webobjects.foundation.NSCoding._IntegerSupport, com.webobjects.foundation.NSCoding._LongSupport, com.webobjects.foundation.NSCoding._NumberSupport, com.webobjects.foundation.NSCoding._ShortSupport, com.webobjects.foundation.NSCoding._StringSupport, com.webobjects.foundation.NSCoding.Support
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
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, CheckForNull, EmptyDictionary, IgnoreNull
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Constructor Summary
ERXMutableDictionary()
           
ERXMutableDictionary(com.webobjects.foundation.NSDictionary<? extends K,? extends V> d)
           
 
Method Summary
 java.lang.Boolean booleanObjectForKey(K key)
           
 java.lang.Object clone()
           
static com.webobjects.foundation.NSDictionary fromBlob(com.webobjects.foundation.NSData d)
           
static com.webobjects.foundation.NSDictionary fromPropertyList(java.lang.String plist)
           
 java.lang.String stringObjectForKey(K key)
          return the string value of an object for key
static
<T,U> com.webobjects.foundation.NSMutableDictionary<T,U>
synchronizedDictionary()
          Returns a new thread-safe mutable dictionary.
static
<T,U> com.webobjects.foundation.NSDictionary<T,U>
synchronizedDictionary(com.webobjects.foundation.NSDictionary<? extends T,? extends U> dict)
          Returns either a new thread-safe dictionary, or just returns dict if the dictionary is not mutable.
static
<T,U> com.webobjects.foundation.NSMutableDictionary<T,U>
synchronizedDictionary(com.webobjects.foundation.NSMutableDictionary<? extends T,? extends U> dict)
          Returns a thread-safe mutable wrapper for the given mutable dictionary.
 com.webobjects.foundation.NSData toBlob()
           
static com.webobjects.foundation.NSData toBlob(ERXMutableDictionary<?,?> dict)
           
static com.webobjects.foundation.NSData toBlob(com.webobjects.foundation.NSDictionary<?,?> d)
           
 java.lang.String toPropertyList()
           
static java.lang.String toPropertyList(com.webobjects.foundation.NSDictionary<?,?> dict)
           
 
Methods inherited from class com.webobjects.foundation.NSMutableDictionary
addEntriesFromDictionary, clear, immutableClone, mutableClone, put, putAll, remove, removeAllObjects, removeObjectForKey, removeObjectsForKeys, setDictionary, setObjectForKey, takeValueForKey, values
 
Methods inherited from class com.webobjects.foundation.NSDictionary
_clearDeletionsAndCollisions, _ensureCapacity, _initializeDictionary, _shallowHashCode, allKeys, allKeysForObject, allValues, classForCoder, containsKey, containsValue, count, decodeObject, emptyDictionary, encodeWithCoder, entrySet, equals, get, hashCode, hashMap, hashtable, isEmpty, isEqualToDictionary, keyEnumerator, keySet, keysNoCopy, objectEnumerator, objectForKey, objectsForKeys, objectsNoCopy, size, takeValueForKeyPath, toString, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

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

ERXMutableDictionary

public ERXMutableDictionary(com.webobjects.foundation.NSDictionary<? extends K,? extends V> d)

ERXMutableDictionary

public ERXMutableDictionary()
Method Detail

toBlob

public static com.webobjects.foundation.NSData toBlob(com.webobjects.foundation.NSDictionary<?,?> d)

toBlob

public static com.webobjects.foundation.NSData toBlob(ERXMutableDictionary<?,?> dict)

fromBlob

public static com.webobjects.foundation.NSDictionary fromBlob(com.webobjects.foundation.NSData d)

fromPropertyList

public static com.webobjects.foundation.NSDictionary fromPropertyList(java.lang.String plist)

toPropertyList

public static java.lang.String toPropertyList(com.webobjects.foundation.NSDictionary<?,?> dict)

toPropertyList

public java.lang.String toPropertyList()

toBlob

public com.webobjects.foundation.NSData toBlob()

clone

public java.lang.Object clone()
Overrides:
clone in class com.webobjects.foundation.NSMutableDictionary<K,V>

stringObjectForKey

public java.lang.String stringObjectForKey(K 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 java.lang.Boolean booleanObjectForKey(K key)
Parameters:
key -

synchronizedDictionary

public static <T,U> com.webobjects.foundation.NSMutableDictionary<T,U> synchronizedDictionary(com.webobjects.foundation.NSMutableDictionary<? extends T,? extends U> 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 <T,U> com.webobjects.foundation.NSMutableDictionary<T,U> synchronizedDictionary()
Returns a new thread-safe mutable dictionary.

Type Parameters:
U -
Returns:
a new thread-safe mutable dictionary

synchronizedDictionary

public static <T,U> com.webobjects.foundation.NSDictionary<T,U> synchronizedDictionary(com.webobjects.foundation.NSDictionary<? extends T,? extends U> dict)
Returns either a new thread-safe 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: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.