net.wotonomy.foundation
Class NSMutableDictionary

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by net.wotonomy.foundation.NSDictionary
              extended by net.wotonomy.foundation.NSMutableDictionary
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map, NSKeyValueCoding

public class NSMutableDictionary
extends NSDictionary

A pure java implementation of NSMutableDictionary that implements Map for greater java interoperability.

Version:
$Revision: 893 $
Author:
michael@mpowers.net, $Author: cgruber $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.wotonomy.foundation.NSKeyValueCoding
NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.Null, NSKeyValueCoding.Utility
 
Field Summary
 
Fields inherited from class net.wotonomy.foundation.NSDictionary
EmptyDictionary
 
Fields inherited from interface net.wotonomy.foundation.NSKeyValueCoding
NullValue
 
Constructor Summary
NSMutableDictionary()
          Default constructor produces an empty dictionary.
NSMutableDictionary(int initialSize)
          Default constructor produces an empty dictionary.
NSMutableDictionary(java.util.Map aMap)
          Produces a dictionary that is a copy of the specified map (or dictionary).
NSMutableDictionary(java.lang.Object[] keys, java.lang.Object[] values)
          Produces a dictionary containing the specified keys and values.
NSMutableDictionary(java.lang.Object key, java.lang.Object value)
          Produces a dictionary that contains one key referencing one value.
 
Method Summary
 void addEntriesFromDictionary(java.util.Map aMap)
          Copies all mappings from the specified dictionary to this dictionary, replacing any mappings this map had for any keys in the specified map.
 void removeAllObjects()
          Removes all mappings from this dictionary.
 void removeObjectForKey(java.lang.Object aKey)
          Removes the key-value pair for the specified key.
 void removeObjectsForKeys(NSArray anArray)
          Removes all keys in the specified array from this dictionary.
 void setDictionary(java.util.Map aMap)
          Clears all mappings in this dictionary and then adds all entries in the specified dictionary.
 void setObjectForKey(java.lang.Object aValue, java.lang.Object aKey)
          Sets the value for the specified key.
 
Methods inherited from class net.wotonomy.foundation.NSDictionary
allKeys, allKeysForObject, allValues, count, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, isEqualToDictionary, keyEnumerator, objectEnumerator, objectForKey, objectsForKeys, storedValueForKey, takeStoredValueForKey, takeValueForKey, toString, unableToSetNullForKey, validateTakeValueForKeyPath, valueForKey
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

NSMutableDictionary

public NSMutableDictionary()
Default constructor produces an empty dictionary.


NSMutableDictionary

public NSMutableDictionary(int initialSize)
Default constructor produces an empty dictionary.


NSMutableDictionary

public NSMutableDictionary(java.lang.Object key,
                           java.lang.Object value)
Produces a dictionary that contains one key referencing one value.


NSMutableDictionary

public NSMutableDictionary(java.lang.Object[] keys,
                           java.lang.Object[] values)
Produces a dictionary containing the specified keys and values. An IllegalArgumentException is thrown if the arrays are not of the same length.


NSMutableDictionary

public NSMutableDictionary(java.util.Map aMap)
Produces a dictionary that is a copy of the specified map (or dictionary).

Method Detail

removeObjectForKey

public void removeObjectForKey(java.lang.Object aKey)
Removes the key-value pair for the specified key.


addEntriesFromDictionary

public void addEntriesFromDictionary(java.util.Map aMap)
Copies all mappings from the specified dictionary to this dictionary, replacing any mappings this map had for any keys in the specified map.


removeAllObjects

public void removeAllObjects()
Removes all mappings from this dictionary.


removeObjectsForKeys

public void removeObjectsForKeys(NSArray anArray)
Removes all keys in the specified array from this dictionary.


setDictionary

public void setDictionary(java.util.Map aMap)
Clears all mappings in this dictionary and then adds all entries in the specified dictionary.


setObjectForKey

public void setObjectForKey(java.lang.Object aValue,
                            java.lang.Object aKey)
Sets the value for the specified key. If the key currently exists to the dictionary, the old value is replaced with the specified value. An IllegalArgumentException is thrown if either the key or value is null.



Copyright © 2006 null. All Rights Reserved.