diff --git a/HTMLKit/HTMLOrderedDictionary.h b/HTMLKit/HTMLOrderedDictionary.h index 088b02a..af0bdde 100644 --- a/HTMLKit/HTMLOrderedDictionary.h +++ b/HTMLKit/HTMLOrderedDictionary.h @@ -10,19 +10,80 @@ NS_ASSUME_NONNULL_BEGIN +/** + An ordered mutable dictionary, that preserves the order of its keys. + */ @interface HTMLOrderedDictionary : NSMutableDictionary +/** + 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)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)aKey; + +/** + Replaces a key keeping the same object. + + @param aKey The old key to replace. + @param newKey The new key. + */ - (void)replaceKey:(KeyType)aKey withKey:(KeyType)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)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 *)reverseKeyEnumerator; @end