StringMap
open class StringMap : MapBase
A map from key type string to value type string.
-
An immutable empty
StringMap.Declaration
Swift
public static let empty: StringMap -
Construct a new map with
sizeof zero and optional initialcapacity. A map can expand in size beyond its initial capacity, but best performance will be obtained if the initial capacity is close to (and not less than) the map’s maximum size.Declaration
Swift
public init(capacity: Int = (16 as Int))Parameters
capacityOptional initial capacity.
-
Declaration
Swift
open func containsValue(forKey key: String) -> BoolParameters
keyEntry key.
Return Value
trueif this map has an entry with the specifiedkey, otherwisefalse. -
Declaration
Swift
open func entries() -> StringMap.EntryListReturn Value
A list of the entries (key/value pairs) in this map.
-
Invert this map of keys to values to another map of values to keys.
Declaration
Swift
open func inverse() -> StringMapReturn Value
New inverted map.
-
Declaration
Swift
open func keys() -> StringListReturn Value
A list of the entry keys in this map.
-
Delete the entry with the specified
key(if found).Declaration
Swift
open func removeValue(forKey key: String) -> BoolParameters
keyEntry key.
Return Value
trueif an entry with the specifiedkeywas found (and deleted). -
Throws
MissingEntryExceptionif no entry is found for the specified key.Declaration
Swift
open func requiredValue(forKey key: String) -> StringParameters
keyEntry key.
Return Value
The value from the entry with the specified
key(if found). -
Declaration
Swift
open func sortedEntries() -> StringMap.EntryListReturn Value
The entries of this map sorted by key.
-
Declaration
Swift
open func sortedKeys() -> StringListReturn Value
The sorted keys of this map.
-
Declaration
Swift
open func sortedValues() -> StringListReturn Value
The sorted values of this map.
-
The underlying untyped map of objects. Use with care, avoiding the addition of objects with an incorrect item type.
Declaration
Swift
override open var untypedMap: UntypedMap { get } -
Add or replace an entry with the specified
keyandvalue.Declaration
Swift
open func updateValue(_ value: String, forKey key: String)Parameters
valueEntry value.
keyEntry key.
-
Declaration
Swift
open func value(forKey key: String) -> String?Parameters
keyEntry key.
Return Value
The value from the entry with the specified
key(if found), otherwisenil. -
Declaration
Swift
open func values() -> StringListReturn Value
A list of the entry values in this map.
-
A key/value pair for map entries.
See moreDeclaration
Swift
open class Entry : ObjectBase