三、M13MutableOrderedDictionary
基于M13OrderedDictionary,M13MutableOrderedDictionary为可变的有序字典类,其中方法解析如下:
//类创建方法
+ (instancetype)orderedDictionaryWithCapacity:(NSUInteger)numEntries;
//初始化方法
- (id)initWithCapacity:(NSUInteger)numEntries;
//添加键值对的方法
- (void)addObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)addEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
- (void)addEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
- (void)addEntriesFromDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)dictionary;
//插入键值对的方法
- (void)insertObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key atIndex:(NSUInteger)index;
- (void)insertEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry atIndex:(NSUInteger)index;
- (void)insertEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary atIndex:(NSUInteger)index;
- (void)insertEntriesFromDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)dictionary atIndex:(NSUInteger)index;
//设置键值对的方法
- (void)setObject:(M13GenericType(ObjectType, id))object forKey:(M13GenericType(KeyType, id<NSCopying>))aKey;
- (void)setEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
- (void)setEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
- (void)setEntriesFromDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)dictionary;
- (void)setObject:(M13GenericType(ObjectType, id))object forKey:(M13GenericType(KeyType, id<NSCopying>))aKey atIndex:(NSUInteger)index;
- (void)setEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry atIndex:(NSUInteger)index;
- (void)setEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary atIndex:(NSUInteger)index;
- (void)setEntriesFromDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)dictionary atIndex:(NSUInteger)index;
//移除键值对的方法
- (void)removeObjectForKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)removeObjectsForKeys:(NSArray M13Generics(KeyType) *)keys;
- (void)removeAllObjects;
- (void)removeAllEntries;
- (void)removeLastEntry;
- (void)removeEntryWithObject:(M13GenericType(ObjectType, id))object;
- (void)removeEntryWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)removeEntryWithObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)removeEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
- (void)removeEntryWithObject:(M13GenericType(ObjectType, id))object inRange:(NSRange)range;
- (void)removeEntryWithKey:(M13GenericType(KeyType, id<NSCopying>))key inRange:(NSRange)range;
- (void)removeEntryWithObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key inRange:(NSRange)ramge;
- (void)removeEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry inRange:(NSRange)range;
- (void)removeEntryAtIndex:(NSUInteger)index;
- (void)removeEntriesAtIndices:(NSIndexSet *)indices;
- (void)removeEntryWithObjectIdenticalTo:(M13GenericType(ObjectType, id))anObject;
- (void)removeEntryWithObjectIdenticalTo:(M13GenericType(ObjectType, id))anObject inRange:(NSRange)range;
- (void)removeEntriesWithObjectsInArray:(NSArray M13Generics(ObjectType) *)array;
- (void)removeEntriesWithKeysInArray:(NSArray M13Generics(KeyType) *)array;
- (void)removeEntriesInRange:(NSRange)range;
//替换键值对的方法
- (void)replaceEntryAtIndex:(NSInteger)index withObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)replaceEntryAtIndex:(NSUInteger)index withEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
- (void)replaceEntriesAtIndices:(NSIndexSet *)indices
withObjects:(NSArray M13Generics(ObjectType) *)objects
pairedWithKeys:(NSArray M13Generics(KeyType) *)keys;
- (void)replaceEntriesAtIndices:(NSIndexSet *)indices
withEntries:(NSArray M13Generics(NSDictionary<KeyType, ObjectType> *) *)orderedEntries;
- (void)replaceEntriesAtIndices:(NSIndexSet *)indices
withEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
- (void)replaceEntriesInRange:(NSRange)range
withObjectsFromArray:(NSArray M13Generics(ObjectType) *)objects
pairedWithKeysFromArray:(NSArray M13Generics(KeyType) *)keys
inRange:(NSRange)range2;
- (void)replaceEntriesInRange:(NSRange)range
withEntriesFrom:(NSArray M13Generics(NSDictionary<KeyType, ObjectType> *) *)orderedEntries
inRange:(NSRange)range2;
- (void)replaceEntriesInRange:(NSRange)range
withEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)dictionary
inRange:(NSRange)range2;
- (void)replaceEntriesInRange:(NSRange)range
withObjectsFromArray:(NSArray M13Generics(ObjectType) *)objects
pairedWithKeysFromArray:(NSArray M13Generics(KeyType) *)keys;
- (void)replaceEntriesInRange:(NSRange)range
withEntriesFrom:(NSArray M13Generics(NSDictionary<KeyType, ObjectType> *) *)orderedEntries;
- (void)replaceEntriesInRange:(NSRange)range
withEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)dictionary;
- (void)setEntriesToObjects:(NSArray M13Generics(ObjectType) *)objects pairedWithKeys:(NSArray M13Generics(KeyType) *)keys;
- (void)setEntriesToOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
//进行元素筛选
- (void)filterEntriesUsingPredicateForObjects:(NSPredicate *)predicate;
//进行元素交换
- (void)exchangeEntryAtIndex:(NSUInteger)idx1 withEntryAtIndex:(NSUInteger)idx2;
//进行元素排序
- (void)sortEntriesByObjectUsingDescriptors:(NSArray *)descriptors;
- (void)sortEntriesByKeysUsingDescriptors:(NSArray *)descriptors;
- (void)sortEntriesByObjectUsingComparator:(NSComparator)cmptr;
- (void)sortEntriesByKeysUsingComparator:(NSComparator)cmptr;
- (void)sortEntriesByObjectWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr;
- (void)sortEntriesByKeysWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr;
- (void)sortEntriesByObjectUsingFunction:(NSInteger (*)(M13GenericType(ObjectType, id),
M13GenericType(ObjectType, id),
void * M13__NULLABLE))compare
context:(M13_NULLABLE void *)context;
- (void)sortEntriesByKeysUsingFunction:(NSInteger (*)(M13GenericType(KeyType, id<NSCopying>),
M13GenericType(KeyType, id<NSCopying>),
void * M13__NULLABLE))compare
context:(M13_NULLABLE void *)context;
- (void)sortEntriesByObjectUsingSelector:(SEL)comparator;
- (void)sortEntriesByKeysUsingSelector:(SEL)comparator;