EnumTypeMap
open class EnumTypeMap : MapBase, @unchecked Sendable
A map from key type string to value type EnumType.
-
An immutable empty
EnumTypeMap.Declaration
Swift
public static let empty: EnumTypeMap -
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.
-
Add an entry to this map using
value.localNameas the entry key andvalueas the entry value.Declaration
Swift
open func add(_ value: EnumType)Parameters
valueValue for new map entry.
-
Declaration
Swift
open class func concurrent() -> EnumTypeMapReturn Value
A thread-safe, concurrent map.
-
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 copy() -> EnumTypeMapReturn Value
A shallow copy of this map.
-
Declaration
Swift
open func entries() -> EnumTypeMap.EntryListReturn Value
A list of the entries (key/value pairs) in this map.
-
Declaration
Swift
open func keys() -> StringListReturn Value
A list of the entry keys in this map.
-
Merge all the entries of
fromto this map, replacing any entry for which the key already exists in this map.Declaration
Swift
open func merge(contentsOf from: EnumTypeMap)Parameters
fromMap of entries to be added.
-
Remove 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
MissingEntryException(fatal) if no entry is found for the specified key.Declaration
Swift
open func requiredValue(forKey key: String) -> EnumTypeParameters
keyEntry key.
Return Value
The value from the entry with the specified
key(if found). -
Declaration
Swift
open func sortedEntries() -> EnumTypeMap.EntryListReturn Value
A sorted list of the entries in this map, using the ordering of
this.keys(). -
Declaration
Swift
open func sortedKeys() -> StringListReturn Value
A sorted list of the keys in this map.
-
Declaration
Swift
open func sortedValues() -> EnumTypeListReturn Value
A sorted list of the values in 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: EnumType, forKey key: String)Parameters
valueEntry value.
keyEntry key.
-
Declaration
Swift
open func value(forKey key: String) -> EnumType?Parameters
keyEntry key.
Return Value
The value from the entry with the specified
key(if found), otherwisenil. -
Declaration
Swift
open func values() -> EnumTypeListReturn Value
A list of the entry values in this map.
-
A key/value pair for map entries.
See moreDeclaration
Swift
open class Entry : ObjectBase