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>
28 namespace Tizen { namespace Base { namespace Collection
33 * @brief This class represents a key-value pair.
37 * The %MapEntry class represents a key-value pair.
39 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/mapentry.htm">MapEntry</a>.
41 class _OSP_EXPORT_ MapEntry
46 * This is the default constructor for this class.
50 * @param[in] key The key
51 * @param[in] value The value
53 MapEntry(const Object& key, const Object& value);
56 * This destructor overrides Tizen::Base::Object::~Object().
60 virtual ~MapEntry(void);
63 * Gets the key corresponding to this entry.
67 * @return The key corresponding to this entry
70 virtual const Object* GetKey(void) const;
73 * Gets the value corresponding to this entry.
77 * @return The value corresponding to this entry
80 virtual const Object* GetValue(void) const;
83 * Gets the key corresponding to this entry.
87 * @return The key corresponding to this entry
90 virtual Object* GetKey(void);
93 * Gets the value corresponding to this entry.
97 * @return The value corresponding to this entry
100 virtual Object* GetValue(void);
103 * Compares the value of the given Tizen::Base::Object to the
104 * value of the calling object.
108 * @return @c true if the values are equal, @n
110 * @param[in] obj The object to compare with the calling object
111 * @remarks This method returns @c false if the given object is not a %MapEntry object.
113 virtual bool Equals(const Object& obj) const;
116 * Gets the hash value of the current instance.
120 * @return The hash value of the current instance
121 * @remarks The two Tizen::Base::Object::Equals() instances must return the same hash value. @n
122 * For better performance, the used hash function must generate a random distribution for all the inputs.
124 virtual int GetHashCode(void) const;
128 * This is the default constructor for this class.
138 * This is the copy constructor for this class.
140 * @param[in] entry The instance of the MapEntry class to copy from
142 MapEntry(const MapEntry& entry);
145 * Assigns the value of the specified instance to the current instance of %MapEntry.
147 * @param[in] entry An instance of %MapEntry
149 MapEntry& operator =(const MapEntry& entry);
151 friend class _MapEntryImpl;
152 class _MapEntryImpl* __pMapEntryImpl;
156 }}} // Tizen::Collection
158 #endif // _FCOL_MAP_ENTRY_H_