Type Aliashummingbird 2.15.0HummingbirdCore
Index
FlatDictionary.swift:27typealias Index = Array<FlatDictionary<Key, Value>.Element>.Index
typealias Index = Array<FlatDictionary<Key, Value>.Element>.Index
import HummingbirdCore
struct FlatDictionary<Key, Value> where Key : Hashable
Provides Dictionary like indexing, but uses a flat array of key value pairs, plus an array of hash keys for lookup for storage.
@frozen struct Array<Element>
An ordered, random-access collection.
typealias Element = (key: Key, value: Value)
typealias Index = Int
The index type for arrays, Int
.
init()
Create a new FlatDictionary
init(_ values: [FlatDictionary<Key, Value>.Element])
Create a new FlatDictionary from an array of key value pairs
init(dictionaryLiteral elements: (Key, Value)...)
Create a new FlatDictionary initialized with a dictionary literal
var endIndex: FlatDictionary<Key, Value>.Index { get }
The position of the element just after the last element
var startIndex: FlatDictionary<Key, Value>.Index { get }
The position of the first element
subscript(key: Key) -> Value? { get set }
Access the value associated with a given key for reading and writing
subscript(index: FlatDictionary<Key, Value>.Index) -> FlatDictionary<Key, Value>.Element { get }
Access element at specific position
subscript(values key: Key) -> [Value] { get }
Return all the values, associated with a given key
mutating func append(key: Key, value: Value)
Append a new key value pair to the list of key value pairs
func has(_ key: Key) -> Bool
Return if dictionary has this value
func index(after index: FlatDictionary<Key, Value>.Index) -> FlatDictionary<Key, Value>.Index
Returns the index immediately after the given index