|
Project Wonder 5.0.0.8795 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecter.extensions.foundation.ERXDictionaryUtilities
public class ERXDictionaryUtilities
Collection of NSDictionary utilities.
| Nested Class Summary | |
|---|---|
static class |
ERXDictionaryUtilities.NSDictionaryKeyValueComparator
Compares dictionary keys based on the value they are associated with. |
| Constructor Summary | |
|---|---|
ERXDictionaryUtilities()
|
|
| Method Summary | |
|---|---|
static void |
_removeMatchingEntries(NSMutableDictionary snapshot1,
NSMutableDictionary snapshot2,
boolean removeInverse)
|
static NSDictionary |
deepClone(NSDictionary dict,
boolean onlyCollections)
|
static NSDictionary |
dictionaryByRemovingFromDictionaryKeysInArray(NSDictionary d,
NSArray a)
Removes an array of keys from a dictionary and returns the result. |
static NSDictionary |
dictionaryByRemovingKeysNotInArray(NSDictionary d,
NSArray a)
Creates a new dictionary with only the keys and objects in the array. |
static NSDictionary |
dictionaryFromObjectWithKeys(Object object,
NSArray keys)
Creates a dictionary from an objects and an array of key paths |
static NSDictionary |
dictionaryFromPropertyList(String name,
NSBundle bundle)
Creates an NSDictionary from a resource associated with a given bundle that is in property list format. |
static NSDictionary |
dictionaryWithDictionaryAndDictionary(NSDictionary dict1,
NSDictionary dict2)
Creates an immutable dictionary containing all of the keys and objects from two dictionaries. |
static NSDictionary |
dictionaryWithObjectsAndKeys(Object[] objectsAndKeys)
Creates a dictionary from a list of alternating objects and keys starting with an object. |
static NSArray |
keysSortedByValueAscending(NSDictionary d)
|
static String |
queryStringForDictionary(NSDictionary<Object,Object> dict,
String separator)
Encodes a dictionary into a string that can be used in a request uri. |
static String |
queryStringForDictionary(NSDictionary<Object,Object> dict,
String separator,
String encoding)
Encodes a dictionary into a string that can be used in a request uri. |
static void |
removeMatchingEntries(NSMutableDictionary dict1,
NSMutableDictionary dict2)
Removes entries from both dictionaries that match, leaving you with two dictionaries containing only values that did NOT match. |
static NSDictionary |
removeNullValues(NSDictionary dict)
|
static void |
setObjectForKeys(NSMutableDictionary dictionary,
Object object,
NSArray keys)
Sets the object for each of the keys in the array on a mutable dictionary. |
static NSArray<String> |
stringKeysSortedAscending(NSDictionary<String,Object> d)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ERXDictionaryUtilities()
| Method Detail |
|---|
public static NSDictionary dictionaryWithDictionaryAndDictionary(NSDictionary dict1,
NSDictionary dict2)
dict1 - the first dictionarydict2 - the second dictionary
public static NSDictionary dictionaryFromPropertyList(String name,
NSBundle bundle)
name - name of the file or resource.bundle - NSBundle to which the resource belongs.
public static NSDictionary dictionaryWithObjectsAndKeys(Object[] objectsAndKeys)
objectsAndKeys - alternating list of objects and keys
public static NSDictionary dictionaryByRemovingFromDictionaryKeysInArray(NSDictionary d,
NSArray a)
d - dictionary to be pruneda - array of keys to be pruned
public static NSDictionary dictionaryByRemovingKeysNotInArray(NSDictionary d,
NSArray a)
d - dictionary to be pruneda - array of keys to be included
public static NSDictionary removeNullValues(NSDictionary dict)
public static NSDictionary dictionaryFromObjectWithKeys(Object object,
NSArray keys)
object - object to pull the values fromkeys - array of keys
public static NSArray<String> stringKeysSortedAscending(NSDictionary<String,Object> d)
public static NSArray keysSortedByValueAscending(NSDictionary d)
d - dictionary to sort keys from
public static void removeMatchingEntries(NSMutableDictionary dict1,
NSMutableDictionary dict2)
dict1 - the first dictionarydict2 - the second dictionary
public static void _removeMatchingEntries(NSMutableDictionary snapshot1,
NSMutableDictionary snapshot2,
boolean removeInverse)
public static void setObjectForKeys(NSMutableDictionary dictionary,
Object object,
NSArray keys)
dictionary - dictionary to mutate. a null dictionary is a no-op.object - object to set. an exception will be thrown if object is null.keys - array of keys to invoke setObjectForKey() for each key. a null
or empty array is a no-op.
public static NSDictionary deepClone(NSDictionary dict,
boolean onlyCollections)
public static String queryStringForDictionary(NSDictionary<Object,Object> dict,
String separator)
dict - dictionary with form valuesseparator - optional value separator
public static String queryStringForDictionary(NSDictionary<Object,Object> dict,
String separator,
String encoding)
dict - dictionary with form valuesseparator - optional value separator
|
Last updated: Fri, Jan 9, 2009 04:35 AM EST | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||