Add source code documentation for the ordered dictionary class

This commit is contained in:
iska
2015-12-21 15:42:32 +01:00
parent ad34deb7ac
commit 3c89df333c
+62 -1
View File
@@ -10,19 +10,80 @@
NS_ASSUME_NONNULL_BEGIN
/**
An ordered mutable dictionary, that preserves the order of its keys.
*/
@interface HTMLOrderedDictionary<KeyType, ObjectType> : NSMutableDictionary<KeyType, ObjectType>
/**
Returns the object at the specified index.
@param index An index within the bounds of the dictionary.
@returns The object located at index.
*/
- (ObjectType)objectAtIndex:(NSUInteger)index;
/**
Sets the object for the given key at the specified index.
@param anObject The object.
@param aKey The key.
@param index An index within the bounds of the dictionary.
*/
- (void)setObject:(ObjectType)anObject forKey:(KeyType<NSCopying>)aKey atIndex:(NSUInteger)index;
/**
Removes the key-value pair located at the specified index.
@param index An index within the bounds of the dictionary.
*/
- (void)removeObjectAtIndex:(NSUInteger)index;
/**
Replaces the key-value pair located at the specified index.
@param index An index within the bounds of the dictionary.
@param anObject The new object.
@param aKey The new key.
*/
- (void)replaceKeyValueAtIndex:(NSUInteger)index withObject:(ObjectType)anObject andKey:(KeyType<NSCopying>)aKey;
/**
Replaces a key keeping the same object.
@param aKey The old key to replace.
@param newKey The new key.
*/
- (void)replaceKey:(KeyType<NSCopying>)aKey withKey:(KeyType<NSCopying>)newKey;
/**
Returns the index of the given key in the dictionary.
@param aKey The key.
@returns The index of the given key in the dictionary.
*/
- (NSUInteger)indexOfKey:(KeyType<NSCopying>)aKey;
/**
Returns the object at the specified index.
@param index An index within the bounds of the dictionary.
@return The object located at index.
*/
- (ObjectType)objectAtIndexedSubscript:(NSUInteger)index;
/**
Replaces the object at the index with the new object.
@param obj The obj with which to replace the object at given index in the dictionary.
@param index The index of the object to be replaced.
*/
- (void)setObject:(ObjectType)obj atIndexedSubscript:(NSUInteger)index;
- (NSEnumerator *)reverseKeyEnumerator;
/**
@returns A reverse key enumerator.
*/
- (NSEnumerator<KeyType> *)reverseKeyEnumerator;
@end