K
- type of key contentsV
- type of value contentspublic class NSDictionary<K,V> extends Object implements Cloneable, Serializable, NSCoding, NSKeyValueCoding, NSKeyValueCodingAdditions, _NSFoundationCollection, Map<K,V>
NSDictionary<String, String> env = new NSDictionary<String, String>(System.getenv(), true);
for (String key : env)
logger.debug(env.valueForKey(key));
Modifier and Type | Class and Description |
---|---|
class |
NSDictionary._JavaNSDictionaryMapEntry<P,Q> |
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
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
Modifier and Type | Field and Description |
---|---|
protected int |
_capacity |
static Class |
_CLASS |
protected int |
_count |
protected int |
_deletionLimit |
protected Set<Map.Entry<K,V>> |
_entrySetCache |
protected byte[] |
_flags |
protected int |
_hashCache |
protected int |
_hashtableBuckets |
protected Object[] |
_keys |
protected Object[] |
_keysCache |
protected Set<K> |
_keySetCache |
static Class |
_MAP_ENTRY_CLASS |
protected static int |
_NSDictionaryClassHashCode |
protected static int |
_NSDictionaryMapEntryHashCode |
protected Object[] |
_objects |
protected Object[] |
_objectsCache |
static boolean |
CheckForNull |
static NSDictionary |
EmptyDictionary |
static boolean |
IgnoreNull |
_KeyPathSeparatorChar, KeyPathSeparator
NullValue
Constructor and Description |
---|
NSDictionary() |
NSDictionary(Dictionary<? extends K,? extends V> dictionary,
boolean ignoreNull) |
NSDictionary(Map<? extends K,? extends V> map) |
NSDictionary(Map<? extends K,? extends V> map,
boolean ignoreNull) |
NSDictionary(NSArray<? extends V> objects,
NSArray<? extends K> keys) |
NSDictionary(NSDictionary<? extends K,? extends V> otherDictionary) |
NSDictionary(V[] objects,
K[] keys) |
NSDictionary(V object,
K key) |
Modifier and Type | Method and Description |
---|---|
protected void |
_clearDeletionsAndCollisions() |
protected void |
_ensureCapacity(int capacity) |
protected void |
_initializeDictionary() |
int |
_shallowHashCode() |
NSArray<K> |
allKeys() |
NSArray<K> |
allKeysForObject(Object object) |
NSArray<V> |
allValues() |
Class |
classForCoder() |
void |
clear() |
Object |
clone() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
int |
count() |
static Object |
decodeObject(NSCoder coder) |
static <K,V> NSDictionary<K,V> |
emptyDictionary() |
void |
encodeWithCoder(NSCoder coder) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object object) |
V |
get(Object key) |
int |
hashCode() |
HashMap<K,V> |
hashMap() |
Hashtable<K,V> |
hashtable() |
NSDictionary<K,V> |
immutableClone() |
boolean |
isEmpty() |
boolean |
isEqualToDictionary(NSDictionary<?,?> otherDictionary) |
Enumeration<K> |
keyEnumerator() |
Set<K> |
keySet() |
protected Object[] |
keysNoCopy() |
NSMutableDictionary<K,V> |
mutableClone() |
Enumeration<V> |
objectEnumerator() |
V |
objectForKey(Object key) |
NSArray<V> |
objectsForKeys(NSArray<? extends K> keys,
V notFoundMarker) |
protected Object[] |
objectsNoCopy() |
static <K,V> NSDictionary<K,V> |
of()
Returns an immutable
NSDictionary containing zero entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1)
Returns an immutable
NSDictionary containing a single entry. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2)
Returns an immutable
NSDictionary containing two entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3)
Returns an immutable
NSDictionary containing three entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4)
Returns an immutable
NSDictionary containing four entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5)
Returns an immutable
NSDictionary containing five entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6)
Returns an immutable
NSDictionary containing six entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7)
Returns an immutable
NSDictionary containing seven entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8)
Returns an immutable
NSDictionary containing eight entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8,
K k9,
V v9)
Returns an immutable
NSDictionary containing nine entries. |
static <K,V> NSDictionary<K,V> |
of(K k1,
V v1,
K k2,
V v2,
K k3,
V v3,
K k4,
V v4,
K k5,
V v5,
K k6,
V v6,
K k7,
V v7,
K k8,
V v8,
K k9,
V v9,
K k10,
V v10)
Returns an immutable
NSDictionary containing ten entries. |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
remove(Object key) |
int |
size() |
void |
takeValueForKey(Object value,
String key) |
void |
takeValueForKeyPath(Object value,
String keyPath) |
String |
toString() |
Object |
valueForKey(String key) |
Object |
valueForKeyPath(String keyPath) |
Collection<V> |
values() |
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static final Class _CLASS
public static final Class _MAP_ENTRY_CLASS
public static final NSDictionary EmptyDictionary
protected transient int _capacity
protected transient int _hashtableBuckets
protected transient int _count
protected Object[] _objects
protected transient Object[] _objectsCache
protected transient byte[] _flags
protected Object[] _keys
protected transient Object[] _keysCache
protected transient int _hashCache
protected transient int _deletionLimit
protected static int _NSDictionaryClassHashCode
protected static int _NSDictionaryMapEntryHashCode
public static final boolean CheckForNull
public static final boolean IgnoreNull
public NSDictionary()
public NSDictionary(NSDictionary<? extends K,? extends V> otherDictionary)
public NSDictionary(Dictionary<? extends K,? extends V> dictionary, boolean ignoreNull)
protected void _initializeDictionary()
protected void _ensureCapacity(int capacity)
protected void _clearDeletionsAndCollisions()
protected Object[] keysNoCopy()
protected Object[] objectsNoCopy()
public int count()
public boolean isEqualToDictionary(NSDictionary<?,?> otherDictionary)
public boolean equals(Object object)
public Enumeration<K> keyEnumerator()
public Enumeration<V> objectEnumerator()
public Object valueForKey(String key)
valueForKey
in interface NSKeyValueCoding
public void takeValueForKey(Object value, String key)
takeValueForKey
in interface NSKeyValueCoding
public Object valueForKeyPath(String keyPath)
valueForKeyPath
in interface NSKeyValueCodingAdditions
public void takeValueForKeyPath(Object value, String keyPath)
takeValueForKeyPath
in interface NSKeyValueCodingAdditions
public Class classForCoder()
classForCoder
in interface NSCoding
public static final <K,V> NSDictionary<K,V> emptyDictionary()
public static <K,V> NSDictionary<K,V> of()
NSDictionary
containing zero entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
public static <K,V> NSDictionary<K,V> of(K k1, V v1)
NSDictionary
containing a single entry.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2)
NSDictionary
containing two entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3)
NSDictionary
containing three entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
NSDictionary
containing four entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
NSDictionary
containing five entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
NSDictionary
containing six entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
NSDictionary
containing seven entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)
NSDictionary
containing eight entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)
NSDictionary
containing nine entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic static <K,V> NSDictionary<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)
NSDictionary
containing ten entries.the
- NSDictionary
's key typethe
- NSDictionary
's value typeNSDictionary
containing the specified mappingpublic void encodeWithCoder(NSCoder coder)
encodeWithCoder
in interface NSCoding
public int _shallowHashCode()
_shallowHashCode
in interface _NSFoundationCollection
public int hashCode()
public NSDictionary<K,V> immutableClone()
public NSMutableDictionary<K,V> mutableClone()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
Copyright © 2002 – 2024 Project Wonder.