X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=inc%2FFBaseColMultiHashMapT.h;h=2e73c3155ce0196f0ce1710ae2f176c220c260ae;hb=60d143778a54ae4c638a08d8c7304b099f70434e;hp=037a2bbf40b079e0f79ff3173fcdac87cc1c3581;hpb=3b569ff3e66a065cb5728bc19d1da493c66f7583;p=platform%2Fframework%2Fnative%2Fappfw.git diff --git a/inc/FBaseColMultiHashMapT.h b/inc/FBaseColMultiHashMapT.h index 037a2bb..2e73c31 100644 --- a/inc/FBaseColMultiHashMapT.h +++ b/inc/FBaseColMultiHashMapT.h @@ -45,13 +45,13 @@ template< class ValueType > class __ValueNodeT; /** * @class MultiHashMapT - * @brief This class represents a template-based collection of associated keys and values that are organized based on the hash code of the key. + * @brief This class represents a template-based collection of associated keys and values that are organized based on the hash code of a key. * * @since 2.0 * - * The %MultiHashMapT class represents a template-based collection of associated keys and values that are organized based on the hash code of the key. - * There is no limit on the number of elements with the same key, but duplicated elements with the same key are not allowed. - * The key and value cannot be null. Several methods in the %MultiHashMapT class need an assignment(=) operator of KeyType, and assignment(=) and equivalent(==) operators of ValueType. + * The %MultiHashMapT class represents a template-based collection of associated keys and values that are organized based on the hash code of a key. + * There is no limit on the number of elements having the same key, but duplicate elements with the same key are not allowed. + * The key and value cannot be @c null. Several methods in the %MultiHashMapT class need an assignment(=) operator of KeyType, as well as assignment(=) and equivalent(==) operators of ValueType. * @n * For more information on the class features, see HashMap and MultiHashMap. * @@ -160,11 +160,12 @@ public: * @since 2.0 * * @return An error code - * @param[in] capacity The initial capacity - * @param[in] loadFactor The maximum ratio of elements to buckets - * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the specified @c capacity or the @c loadFactor is negative. + * @param[in] capacity The initial capacity + * @param[in] loadFactor The maximum ratio of elements to buckets + * @exception E_SUCCESS The method is successful. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid. + * - The specified @c capacity or the specified @c loadFactor is negative. * @remarks The key type must be a primitive data type. * @see MultiHashMapT() */ @@ -233,14 +234,16 @@ CATCH: * @since 2.0 * * @return An error code - * @param[in] map A map to copy - * @param[in] loadFactor The maximum ratio of elements to buckets @n - * If it is @c 0, the default load factor(0.75) is used. + * @param[in] map The map to copy + * @param[in] loadFactor The maximum ratio of elements to buckets @n + * If it is @c 0, the default load factor(0.75) is used. * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the specified @c loadFactor is negative. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or - * the @c map is modified during the operation of this method. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid + * - The specified @c loadFactor is negative. + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: + * - The current state of the instance prohibits the execution of the specified operation. + * - The specified @c map is modified during the operation of this method. * @see MultiHashMapT() */ result Construct(const IMultiMapT< KeyType, ValueType >& map, float loadFactor = 0.75) @@ -286,17 +289,18 @@ CATCH: * @since 2.0 * * @return An error code - * @param[in] capacity The initial capacity @n - * If it is @c 0, the default capacity(16) is used. - * @param[in] loadFactor The maximum ratio of elements to buckets @n - * If it is @c 0, the default load factor(0.75) is used. - * @param[in] provider An instance of the IHashCodeProvider derived class that supplies the hash codes - * for all keys in this map - * @param[in] comparer An instance of the IComparer derived class to use when comparing keys + * @param[in] capacity The initial capacity @n + * If it is @c 0, the default capacity(16) is used. + * @param[in] loadFactor The maximum ratio of elements to buckets @n + * If it is @c 0, the default load factor(0.75) is used. + * @param[in] provider An instance of the IHashCodeProvider derived class that supplies the hash codes + * for all the keys in this map + * @param[in] comparer An instance of the IComparer derived class to use when comparing the keys * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the specified @c capacity or the @c loadFactor is negative. - * @remarks The instances of hash code provider and comparer will not be deallocated later from this map. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid. + * - The specified @c capacity or the specified @c loadFactor is negative. + * @remarks The instances of hash code provider and the comparer are not deallocated later from this map. * @see MultiHashMapT() */ result Construct(int capacity, float loadFactor, const IHashCodeProviderT< KeyType >& provider, @@ -361,18 +365,20 @@ CATCH: * @since 2.0 * * @return An error code - * @param[in] map A map to copy - * @param[in] loadFactor The maximum ratio of elements to buckets @n - * If it is @c 0, the default load factor(0.75) is used. - * @param[in] provider An instance of the IHashCodeProvider derived class that supplies the hash codes - * for all keys in this map - * @param[in] comparer An instance of the IComparer derived class to use when comparing keys + * @param[in] map The map to copy + * @param[in] loadFactor The maximum ratio of elements to buckets @n + * If it is @c 0, the default load factor(0.75) is used. + * @param[in] provider An instance of the IHashCodeProvider derived class that supplies the hash codes + * for all the keys in this map + * @param[in] comparer An instance of the IComparer derived class to use when comparing the keys * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the specified @c loadFactor is negative. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or - * the @c map is modified during the operation of this method. - * @remarks The instances of hash code provider and comparer will not be deallocated later from this map. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid. + * - The specified @c loadFactor is negative. + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: + * - The current state of the instance prohibits the execution of the specified operation. + * - The specified @c map is modified during the operation of this method. + * @remarks The instances of the hash code provider and the comparer are not deallocated later from this map. * @see MultiHashMapT() */ result Construct(const IMultiMapT< KeyType, ValueType >& map, float loadFactor, const IHashCodeProviderT< KeyType >& provider, @@ -415,14 +421,15 @@ CATCH: * @since 2.0 * * @return An error code - * @param[in] key A key of the value to add - * @param[in] value A value to add + * @param[in] key The key of the value to add + * @param[in] value The value to add * @exception E_SUCCESS The method is successful. - * @exception E_OBJ_ALREADY_EXIST The specified pair of @c key and @c value already exists. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the comparer has failed to compare the keys. - * @remarks SetItem() can be used to set value to a key that does not already exist. - * However, setting a value to a key that already exists overwrites the value. + * @exception E_OBJ_ALREADY_EXIST The specified @c key and @c value pair already exists. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid. + * - The comparer has failed to compare the keys. + * @remarks SetItem() can be used to set a value to a key that does not already exist. @n + * However, setting a value to a key that already exists overwrites this value. * @see Remove() * @see SetValue() */ @@ -497,16 +504,18 @@ CATCH: } /** - * Gets an enumerator of this map. + * Gets the enumerator of this map. * * @since 2.0 * - * @return An enumerator (an instance of the %IMapEnumeratorT derived class) of this map, @n + * @return The enumerator (an instance of the IMapEnumeratorT derived class) of this map, @n * else @c null if an exception occurs * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @remarks If the key has multiple values, the Enumeration proceeds as follows: {A: a}, {B: b}, {B: c}, {B, d}, {C: e}, ... - * The specific error code can be accessed using the GetLastResult() method. + * @remarks + * - If the key has multiple values, the enumeration proceeds as follows: @n + * {A: a}, {B: b}, {B: c}, {B, d}, {C: e}, ... + * - The specific error code can be accessed using the GetLastResult() method. * @see Tizen::Base::Collection::IEnumerator * @see Tizen::Base::Collection::IMapEnumerator */ @@ -526,16 +535,18 @@ CATCH: } /** - * Gets an IMapEnumerator of this map. + * Gets the IMapEnumerator of this map. * * @since 2.0 * - * @return An enumerator (an instance of the %IMapEnumeratorT derived class) of this map, @n + * @return The enumerator (an instance of the IMapEnumeratorT derived class) of this map, @n * else @c null if an exception occurs - * @exception E_SUCCESS The method is successful. - * @exception E_OUT_OF_MEMORY The memory is insufficient. - * @remarks If the key has multiple values, the Enumeration proceeds like this: {A: a}, {B: b}, {B: c}, {B, d}, {C: e}, ... - * @remarks The specific error code can be accessed using the GetLastResult() method. + * @exception E_SUCCESS The method is successful. + * @exception E_OUT_OF_MEMORY The memory is insufficient. + * @remarks + * - If the key has multiple values, the enumeration proceeds like this: @n + * {A: a}, {B: b}, {B: c}, {B, d}, {C: e}, ... + * - The specific error code can be accessed using the GetLastResult() method. * @see Tizen::Base::Collection::IEnumerator * @see Tizen::Base::Collection::IMapEnumerator */ @@ -545,17 +556,18 @@ CATCH: } /** - * Gets an enumerator of the values associated with the specified key. + * Gets the enumerator of the values associated with the specified key. * * @since 2.0 * - * @return An enumerator (an instance of the IEnumeratorT derived class) of the values associated with the specified key, @n + * @return The enumerator (an instance of the IEnumeratorT derived class) of the values associated with the specified key, @n * else @c null if an exception occurs - * @param[in] key A key to locate + * @param[in] key The key to locate * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the comparer has failed to compare the keys. - * @exception E_OBJ_NOT_FOUND The specified @c key is not found in the map. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid. + * - The comparer has failed to compare the keys. + * @exception E_OBJ_NOT_FOUND The specified @c key has not been found in the map. * @remarks The specific error code can be accessed using the GetLastResult() method. * @see SetValue() */ @@ -596,11 +608,11 @@ CATCH: } /** - * Gets a list of all unique keys in this map. + * Gets a list of all the unique keys in this map. * * @since 2.0 * - * @return A list of all unique keys in this map, @n + * @return The list of all the unique keys in this map, @n * else @c null if an exception occurs * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_MEMORY The memory is insufficient. @@ -642,7 +654,7 @@ CATCH: * * @since 2.0 * - * @return A list of all the values in this map, @n + * @return The list of all the values in this map, @n * else @c null if an exception occurs * @exception E_SUCCESS The method is successful. * @exception E_OUT_OF_MEMORY The memory is insufficient. @@ -688,9 +700,10 @@ CATCH: * @return An error code * @param[in] key The key to remove * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The specified input parameter is invalid, or - * the comparer has failed to compare the keys. - * @exception E_OBJ_NOT_FOUND The specified @c key is not found in the map. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified input parameter is invalid. + * - The comparer has failed to compare the keys. + * @exception E_OBJ_NOT_FOUND The specified @c key has not been found in the map. * @see Add() */ virtual result Remove(const KeyType& key) @@ -748,11 +761,12 @@ CATCH: * @since 2.0 * * @return An error code - * @param[in] key The key whose mapping is to remove from the map - * @param[in] value The value to remove + * @param[in] key The key whose mapping is removed from the map + * @param[in] value The value to remove * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the comparer has failed to compare the keys. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid. + * - The comparer has failed to compare the keys. * @exception E_OBJ_NOT_FOUND The specified @c key and @c value pair is not found in the map. * @see Add() */ @@ -824,7 +838,7 @@ CATCH: } /** - * Removes all key-value pairs in this map. + * Removes all the key-value pairs in this map. * * @since 2.0 */ @@ -839,20 +853,20 @@ CATCH: } /** - * Replaces the value associated with the key with the specified @c newValue. + * Replaces the value associated with the key, with the specified @c newValue. * * @since 2.0 * * @return An error code - * @param[in] key A key - * @param[in] value A value to replace - * @param[in] newValue A new value to replace the existing value + * @param[in] key The key + * @param[in] value The value to replace + * @param[in] newValue The new value to replace the existing value * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the comparer has failed to compare the keys. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The specified input parameter is invalid. + * - The comparer has failed to compare the keys. * @exception E_OBJ_NOT_FOUND The specified @c key and @c value pair is not found in the map. * @remarks To add a new key-value pair, use the Add() method. - * @see Add() * @see GetValuesN() */ virtual result SetValue(const KeyType& key, const ValueType& value, const ValueType& newValue) @@ -925,11 +939,12 @@ CATCH: * @since 2.0 * * @return An error code - * @param[in] key A key to locate - * @param[out] count The number of values whose key is @c key + * @param[in] key The key to locate + * @param[out] count The number of values whose key is @c key * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the comparer has failed to compare the keys. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid. + * - The comparer has failed to compare the keys. * @exception E_OBJ_NOT_FOUND The specified @c key is not found in the map. */ virtual result GetCount(const KeyType& key, int& count) const @@ -971,13 +986,14 @@ CATCH: * @since 2.0 * * @return An error code - * @param[in] key The key to locate - * @param[in] value The value to locate - * @param[out] out Set to @c true if the map contains the specified key and value pair, @n - * else @c false + * @param[in] key The key to locate + * @param[in] value The value to locate + * @param[out] out Set to @c true if the map contains the specified key and value pair, @n + * else @c false * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG The current state of the instance prohibits the execution of the specified operation, or - * the comparer has failed to compare the keys. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - The current state of the instance prohibits the execution of the specified operation. + * - The comparer has failed to compare the keys. * @see ContainsKey() * @see ContainsValue() */ @@ -1027,12 +1043,13 @@ CATCH: * @since 2.0 * * @return An error code - * @param[in] key The key to locate - * @param[out] out Set to @c true if the map contains the specified key, @n - * else @c false + * @param[in] key The key to locate + * @param[out] out Set to @c true if the map contains the specified key, @n + * else @c false * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_ARG A specified input parameter is invalid, or - * the comparer has failed to compare the keys. + * @exception E_INVALID_ARG Either of the following conditions has occurred: + * - A specified input parameter is invalid. + * - The comparer has failed to compare the keys. * @see ContainsValue() * @see Contains() */ @@ -1114,7 +1131,7 @@ CATCH: * else @c false * @param[in] obj The object to compare with the current instance * @remarks This method returns @c true only if the specified object is also an instance of the %MultiHashMapT class, - * both maps have the same number of elements, and both maps contain the same elements. + * both the maps have the same number of elements, and both the maps contain the same elements. */ virtual bool Equals(const Object& obj) const { @@ -1165,8 +1182,8 @@ CATCH: * @since 2.0 * * @return The hash value of the current instance - * @remarks The two Tizen::Base::Object::Equals() instances must return the same hash value. For better performance, @n - * the used hash function must generate a random distribution for all inputs. + * @remarks The two Tizen::Base::Object::Equals() instances must return the same hash value. @n + * For better performance, the used hash function must generate a random distribution for all the inputs. */ virtual int GetHashCode(void) const { @@ -1375,7 +1392,7 @@ public: * * @since 2.0 * - * @param[in] v An object to include in this node + * @param[in] v The object to include in this node */ __ValueNodeT(const ValueType& v) : pNext(null) @@ -1423,11 +1440,11 @@ public: * * @since 2.0 * - * @param[in] keyType A key to include in this entry - * @param[in] list A list of values whose key is specified @n + * @param[in] keyType The key to include in this entry + * @param[in] list The list of values whose key is specified @n * It cannot be @c null. * @param[in] next A pointer to the next entry - * @param[in] h An hash value of the key + * @param[in] h The hash value of the key */ __MultiHashMapEntryT(const KeyType& keyType, __ValueNodeT< ValueType >* list, __MultiHashMapEntryT< KeyType, ValueType >* next, int h) : key(keyType) @@ -1502,7 +1519,7 @@ public: * * @since 2.0 * - * @param[in] map A map to enumerate + * @param[in] map The map to enumerate * @param[in] modCount The modification count to detect the change in the map */ __MultiHashMapEnumeratorT(const MultiHashMapT< KeyType, ValueType >& map, int modCount) @@ -1530,10 +1547,10 @@ public: * * @return An error code * @param[out] obj The current object - * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: * - The current state of the instance prohibits the execution of the specified operation. @n * - This enumerator is currently positioned before the first element or - * past the last element. @n + * past the last element. * - The map is modified after this enumerator is created. * @exception E_SUCCESS The method is successful. */ @@ -1551,14 +1568,15 @@ public: /** * Moves this enumerator to the next element of the map. @n * After the enumerator is first created or reset using the Reset() method, - * the first call to this method positions the enumerator to the first element in the @c collection. + * the first call to this method positions the enumerator to the first element in the collection. * * @since 2.0 * * @return An error code * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or - * the map is modified after this enumerator is created. + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: + * - The current state of the instance prohibits the execution of the specified operation. + * - The map is modified after this enumerator is created. * @exception E_OUT_OF_RANGE The enumerator has passed the end of the map. * @see Reset() */ @@ -1606,8 +1624,9 @@ public: * * @return An error code * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or - * the map is modified after this enumerator is created. + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: + * - The current state of the instance prohibits the execution of the specified operation. + * - The map is modified after this enumerator is created. */ result Reset(void) { @@ -1627,11 +1646,11 @@ public: * * @return An error code * @param[out] key The current key - * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: * - The current state of the instance prohibits the execution of the specified operation. @n * - This enumerator is currently positioned before the first element or - * past the last element. @n - * - The map is modified after this enumerator is created. + * past the last element. @n + * - The map is modified after this enumerator is created. * @exception E_SUCCESS The method is successful. */ result GetKey(KeyType& key) const @@ -1652,10 +1671,10 @@ public: * * @return An error code * @param[out] value The current value - * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: * - The current state of the instance prohibits the execution of the specified operation. @n * - This enumerator is currently positioned before the first element or - * past the last element. @n + * past the last element. @n * - The map is modified after the enumerator is created. * @exception E_SUCCESS The method is successful. */ @@ -1695,7 +1714,7 @@ public: * * @since 2.0 * - * @param[in] entry An entry to enumerate + * @param[in] entry The entry to enumerate * @param[in] modCount The modification count to detect the change in the entry */ __EntryValueEnumeratorT(const __MultiHashMapEntryT< KeyType, ValueType >& entry, int modCount) @@ -1722,10 +1741,10 @@ public: * * @return An error code * @param[out] obj The current value - * @exception E_INVALID_OPERATION Either of the following conditions has occurred: @n + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: * - The current state of the instance prohibits the execution of the specified operation. @n * - This enumerator is currently positioned before the first element or - * past the last element. @n + * past the last element. * - The entry is modified after this enumerator is created. * @exception E_SUCCESS The method is successful. */ @@ -1748,8 +1767,9 @@ public: * * @return An error code * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or - * the entry is modified after this enumerator is created. + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: + * - The current state of the instance prohibits the execution of the specified operation. + * - The entry is modified after this enumerator is created. * @exception E_OUT_OF_RANGE The enumerator has passed the end of the entry. * @see Reset() */ @@ -1784,8 +1804,9 @@ public: * * @return An error code * @exception E_SUCCESS The method is successful. - * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or - * the entry is modified after this enumerator is created. + * @exception E_INVALID_OPERATION Either of the following conditions has occurred: + * - The current state of the instance prohibits the execution of the specified operation. + * - The entry is modified after this enumerator is created. */ result Reset(void) {