MutableDictionary
Mutable access to dictionary data.
Constructors
Construct a new empty Dictionary object.
Creates a new MutableDictionary with content from the passed Map. Allowed value types are List, Instant, Map, Number, null, String, Array, Blob, and Dictionary. If present, Lists, Arrays, Maps and Dictionaries may contain only the above types.
Creates a new MutableDictionary with content from the passed JSON string.
Functions
Tests whether a property exists or not. This can be less expensive than getValue(String), because it does not have to allocate an Object for the property value.
Subscript access to a Fragment object by key.
Subscripting access to a MutableFragment object that represents the value of the dictionary by key.
Get a property's value as an Array. Returns null if the property doesn't exist, or its value is not an array.
Gets a property's value as a boolean. Returns true if the value exists, and is either true
or a nonzero number.
Gets a property's value as an Instant date. JSON does not directly support dates, so the actual property value must be a string, which is then parsed according to the ISO-8601 date format (the default used in JSON.) Returns null if the value doesn't exist, is not a string, or is not parsable as a date. NOTE: This is not a generic date parser! It only recognizes the ISO-8601 format, with or without milliseconds.
Get a property's value as a Dictionary. Returns null if the property doesn't exist, or its value is not a dictionary.
Gets a property's value as a double. Integers will be converted to double. The value true
is returned as 1.0, false
as 0.0. Returns 0.0 if the property doesn't exist or does not have a numeric value.
Gets a property's value as a float. Integers will be converted to float. The value true
is returned as 1.0, false
as 0.0. Returns 0.0 if the value doesn't exist or does not have a numeric value.
Gets a property's value as a long. Floating point values will be rounded. The value true
is returned as 1, false
as 0. Returns 0 if the value doesn't exist or does not have a numeric value.
Gets a property's value as an object. The object types are Blob, Array, Dictionary, Number, or String based on the underlying data type; or nil if the property value is null or the property doesn't exist.
An iterator over keys of this Dictionary. A call to the next()
method of the returned iterator will throw a ConcurrentModificationException, if the MutableDictionary is modified while it is in use.
Removes the mapping for a key from this Dictionary
Set an Array object for the given key.
Set a Blob object for the given key.
Set a boolean value for the given key.
Populate a dictionary with content from a Map. Allowed value types are List, Instant, Map, Number, null, String, Array, Blob, and Dictionary. If present, Lists, Arrays, Maps and Dictionaries may contain only the above types. Setting the dictionary content will replace the current data including any existing Array and Dictionary objects.
Set an Instant date object for the given key.
Set a Dictionary object for the given key.
Set a double value for the given key.
Set a float value for the given key.
Set an int value for the given key.
Populate a dictionary with content from a JSON string. Setting the dictionary content will replace the current data including any existing Array and Dictionary objects.
Set a long value for the given key.
Set a Number value for the given key.
Set a String value for the given key.
Set an object value by key. Allowed value types are List, Instant, Map, Number, null, String, Array, Blob, and Dictionary. If present, Lists, Arrays, Maps and Dictionaries may contain only the above types.
Return a mutable copy of the dictionary