字典
使用对值进行索引的键映射数据
字典是一种将每个键与对应的值相关联的数据结构体。键和值可以采用任何数据类型,为数据访问提供优于数组索引的灵活性,并能提高性能。
函数
dictionary | Object that maps unique keys to values |
entries | Key-value pairs of dictionary |
keys | Keys of dictionary |
values | Values of dictionary |
types | Types of dictionary keys and values |
numEntries | Number of key-value pairs in dictionary |
isConfigured | Determine if dictionary has types assigned to keys and values |
isKey | Determine if dictionary contains key |
keyHash | Generate hash code for dictionary key |
keyMatch | Determine if two dictionary keys are the same |
主题
- Map Data with Dictionaries
Use dictionaries to store key-value pairs of different data types.
- Dictionaries and Custom Classes
Modify custom classes for expected behavior in dictionaries.