|
Project Wonder 5.0 | |||||||||||
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
|
_removeMatchingEntries(com.webobjects.foundation.NSMutableDictionary<? extends K,? extends V> snapshot1,
com.webobjects.foundation.NSMutableDictionary<? extends K,? extends V> snapshot2,
boolean removeInverse)
|
|
static
|
deepClone(com.webobjects.foundation.NSDictionary<K,V> dict,
boolean onlyCollections)
Returns a deep clone of the given dictionary. |
|
static
|
dictionaryByRemovingFromDictionaryKeysInArray(com.webobjects.foundation.NSDictionary<K,V> d,
com.webobjects.foundation.NSArray<K> a)
Removes an array of keys from a dictionary and returns the result. |
|
static
|
dictionaryByRemovingKeysNotInArray(com.webobjects.foundation.NSDictionary<K,V> d,
com.webobjects.foundation.NSArray<K> a)
Creates a new dictionary with only the keys and objects in the array. |
|
static com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> |
dictionaryFromObjectWithKeys(java.lang.Object object,
com.webobjects.foundation.NSArray<java.lang.String> keys)
Creates a dictionary from an objects and an array of key paths |
|
static com.webobjects.foundation.NSDictionary |
dictionaryFromPropertyList(java.lang.String name,
com.webobjects.foundation.NSBundle bundle)
Creates an NSDictionary from a resource associated with a given bundle that is in property list format. |
|
static
|
dictionaryWithDictionaryAndDictionary(com.webobjects.foundation.NSDictionary<? extends K,? extends V> dict1,
com.webobjects.foundation.NSDictionary<? extends K,? extends V> dict2)
Creates an immutable dictionary containing all of the keys and objects from two dictionaries. |
|
static com.webobjects.foundation.NSDictionary |
dictionaryWithObjectsAndKeys(java.lang.Object[] objectsAndKeys)
Creates a dictionary from a list of alternating objects and keys starting with an object. |
|
static
|
keysSortedByValueAscending(com.webobjects.foundation.NSDictionary<T,?> d)
|
|
static java.lang.String |
queryStringForDictionary(com.webobjects.foundation.NSDictionary<?,?> dict,
java.lang.String separator)
Encodes a dictionary into a string that can be used in a request uri. |
|
static java.lang.String |
queryStringForDictionary(com.webobjects.foundation.NSDictionary<?,?> dict,
java.lang.String separator,
java.lang.String encoding)
Encodes a dictionary into a string that can be used in a request uri. |
|
static
|
removeMatchingEntries(com.webobjects.foundation.NSMutableDictionary<? extends K,? extends V> dict1,
com.webobjects.foundation.NSMutableDictionary<? extends K,? extends V> dict2)
Removes entries from both dictionaries that match, leaving you with two dictionaries containing only values that did NOT match. |
|
static
|
removeNullValues(com.webobjects.foundation.NSDictionary<K,V> dict)
|
|
static
|
setObjectForKeys(com.webobjects.foundation.NSMutableDictionary<K,V> dictionary,
V object,
com.webobjects.foundation.NSArray<K> keys)
Sets the object for each of the keys in the array on a mutable dictionary. |
|
static com.webobjects.foundation.NSArray<java.lang.String> |
stringKeysSortedAscending(com.webobjects.foundation.NSDictionary<java.lang.String,?> 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 <K,V> com.webobjects.foundation.NSDictionary<K,V> dictionaryWithDictionaryAndDictionary(com.webobjects.foundation.NSDictionary<? extends K,? extends V> dict1, com.webobjects.foundation.NSDictionary<? extends K,? extends V> dict2)
dict1
- the first dictionarydict2
- the second dictionary
public static com.webobjects.foundation.NSDictionary dictionaryFromPropertyList(java.lang.String name, com.webobjects.foundation.NSBundle bundle)
name
- name of the file or resource.bundle
- NSBundle to which the resource belongs.
public static com.webobjects.foundation.NSDictionary dictionaryWithObjectsAndKeys(java.lang.Object[] objectsAndKeys)
objectsAndKeys
- alternating list of objects and keys
public static <K,V> com.webobjects.foundation.NSDictionary<K,V> dictionaryByRemovingFromDictionaryKeysInArray(com.webobjects.foundation.NSDictionary<K,V> d, com.webobjects.foundation.NSArray<K> a)
d
- dictionary to be pruneda
- array of keys to be pruned
public static <K,V> com.webobjects.foundation.NSDictionary<K,V> dictionaryByRemovingKeysNotInArray(com.webobjects.foundation.NSDictionary<K,V> d, com.webobjects.foundation.NSArray<K> a)
d
- dictionary to be pruneda
- array of keys to be included
public static <K,V> com.webobjects.foundation.NSDictionary<K,V> removeNullValues(com.webobjects.foundation.NSDictionary<K,V> dict)
public static com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> dictionaryFromObjectWithKeys(java.lang.Object object, com.webobjects.foundation.NSArray<java.lang.String> keys)
object
- object to pull the values fromkeys
- array of keys
public static com.webobjects.foundation.NSArray<java.lang.String> stringKeysSortedAscending(com.webobjects.foundation.NSDictionary<java.lang.String,?> d)
public static <T> com.webobjects.foundation.NSArray<T> keysSortedByValueAscending(com.webobjects.foundation.NSDictionary<T,?> d)
d
- dictionary to sort keys from
public static <K,V> void removeMatchingEntries(com.webobjects.foundation.NSMutableDictionary<? extends K,? extends V> dict1, com.webobjects.foundation.NSMutableDictionary<? extends K,? extends V> dict2)
dict1
- the first dictionarydict2
- the second dictionarypublic static <K,V> void _removeMatchingEntries(com.webobjects.foundation.NSMutableDictionary<? extends K,? extends V> snapshot1, com.webobjects.foundation.NSMutableDictionary<? extends K,? extends V> snapshot2, boolean removeInverse)
public static <K,V> void setObjectForKeys(com.webobjects.foundation.NSMutableDictionary<K,V> dictionary, V object, com.webobjects.foundation.NSArray<K> 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 <K,V> com.webobjects.foundation.NSDictionary<K,V> deepClone(com.webobjects.foundation.NSDictionary<K,V> dict, boolean onlyCollections)
dict
- the dictionary to cloneonlyCollections
- if true, only collections in this dictionary will be cloned, not individual values
public static java.lang.String queryStringForDictionary(com.webobjects.foundation.NSDictionary<?,?> dict, java.lang.String separator)
dict
- dictionary with form valuesseparator
- optional value separatorpublic static java.lang.String queryStringForDictionary(com.webobjects.foundation.NSDictionary<?,?> dict, java.lang.String separator, java.lang.String encoding)
dict
- dictionary with form valuesseparator
- optional value separator
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |