2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBaseColMapEntry.h
19 * @brief This is the header file for the %MapEntry class.
21 * This header file contains the declarations of the %MapEntry class.
23 #ifndef _FCOL_MAP_ENTRY_H_
24 #define _FCOL_MAP_ENTRY_H_
26 #include <FBaseObject.h>
29 namespace Tizen { namespace Base { namespace Collection
34 * @brief This class represents a key-value pair.
38 * The %MapEntry class represents a key-value pair.
40 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/mapentry.htm">MapEntry</a>.
42 class _OSP_EXPORT_ MapEntry
47 * This is the default constructor for this class.
51 * @param[in] key The key
52 * @param[in] value The value
54 MapEntry(const Object& key, const Object& value);
57 * This destructor overrides Tizen::Base::Object::~Object().
61 virtual ~MapEntry(void);
64 * Gets the key corresponding to this entry.
68 * @return The key corresponding to this entry
71 virtual const Object* GetKey(void) const;
74 * Gets the value corresponding to this entry.
78 * @return The value corresponding to this entry
81 virtual const Object* GetValue(void) const;
84 * Gets the key corresponding to this entry.
88 * @return The key corresponding to this entry
91 virtual Object* GetKey(void);
94 * Gets the value corresponding to this entry.
98 * @return The value corresponding to this entry
101 virtual Object* GetValue(void);
104 * Compares the value of the given Object to the
105 * value of the calling object.
109 * @return @c true if the values are equal, @n
111 * @param[in] obj The object to compare with the calling object
112 * @remarks Returns @c false if the given object is not a %MapEntry object.
114 virtual bool Equals(const Object& obj) const;
117 * Gets the hash value of the current instance.
121 * @return The hash value of the current instance
122 * @remarks The two Tizen::Base::Object::Equals() instances must return the same hash value. For better performance, @n
123 * the used hash function must generate a random distribution for all inputs.
125 virtual int GetHashCode(void) const;
129 * This is the default constructor for this class.
139 * This is the copy constructor for this class.
141 * @param[in] entry The instance of the MapEntry class to copy from
143 MapEntry(const MapEntry& entry);
146 * Assigns the value of the specified instance to the current instance of %MapEntry.
148 * @param[in] entry An instance of %MapEntry
150 MapEntry& operator =(const MapEntry& entry);
152 friend class _MapEntryImpl;
153 class _MapEntryImpl* __pMapEntryImpl;
157 }}} // Tizen::Collection
159 #endif // _FCOL_MAP_ENTRY_H_