BijectiveDictionary 1.0.5

BijectiveDictionary 1.0.5

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2016年3月

Peter Meyers 维护。



  • Peter Meyers 和 Zach Langley

一个同时保持键和值唯一性的字典。

当您需要使用 BijectiveDictionary 时:

  • 强制键和值都唯一。
  • 在 O(1) 时间内按键查找值。
  • 在 O(1) 时间内按值查找键。
  • 在 O(1) 时间内检索逆映射。

BijectiveDictionary 通过六个类实现了排序、可变性和线程安全。

  • OPCBijectiveDictionary
  • OPCMutableBijectiveDictionary
  • OPCOrderedBijectiveDictionary
  • OPCMutableOrderedBijectiveDictionary
  • OPCThreadSafeMutableBijectiveDictionary
  • OPCThreadSafeMutableOrderedBijectiveDictionary

示例用法

OPCMutableBijectiveDictionary *dict = [OPCMutableBijectiveDictionary dictionary];

// Add a new key-value pair.
dict[@"key"] = @"value";

// Retrieve the value for @"key".
NSString *value = dict[@"key"];

// Retrieve the key for @"value".
NSString *key = dict.inverse[@"value"];

要求

最低 iOS 目标:5.0

安装

BijectiveDictionary 通过 CocoaPods 提供。要安装,请将以下行添加到您的 Podfile 中,然后运行 pod install

pod 'BijectiveDictionary'

作者

许可证

BijectiveDictionary 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。