mFrame
載入中...
搜尋中...
無符合項目
Map.h
1
8
#ifndef MFRAME_EC6FEC6D_9D9D_4888_A683_6B2477CEEC38
9
#define MFRAME_EC6FEC6D_9D9D_4888_A683_6B2477CEEC38
10
11
/* ***************************************************************************************
12
* Include
13
*/
14
15
//----------------------------------------------------------------------------------------
16
17
//----------------------------------------------------------------------------------------
18
#include "./../lang/Iterable.h"
19
#include "./../util/Container.h"
20
21
/* ***************************************************************************************
22
* Namespace
23
*/
24
namespace
ufm::util
{
31
template
<
typename
V>
32
struct
Map;
33
}
// namespace ufm::util
34
35
/* ***************************************************************************************
36
* Class/Interface/Struct
37
*/
38
47
template
<
typename
V =
void
>
48
struct
ufm::util::Map
:
public
ufm::util::Container
{
49
/* *************************************************************************************
50
* SubClass Entry
51
*/
52
58
struct
Entry
{
59
/* ***********************************************************************************
60
* Method
61
*/
67
virtual
int
getKey
(
void
) abstract;
68
74
virtual
V*
getValue
(
void
) abstract;
75
82
virtual
V*
setValue
(V* value) abstract;
83
88
virtual
void
remove
(
void
) abstract;
89
};
90
91
/* *************************************************************************************
92
* Method
93
*/
94
102
virtual
bool
containsKey
(
ufm::lang::Interface
& key)
const
abstract;
103
111
virtual
bool
containsValue
(V* value)
const
abstract;
112
119
virtual
V*
get
(
ufm::lang::Interface
& key)
const
abstract;
120
128
virtual
V*
put
(
ufm::lang::Interface
& key, V* value) abstract;
129
136
virtual
V*
remove
(
ufm::lang::Interface
& key) abstract;
137
145
virtual
V*
replace
(
ufm::lang::Interface
& key, V* value) abstract;
146
};
147
148
/* ***************************************************************************************
149
* End of file
150
*/
151
152
#endif
/* MFRAME_EC6FEC6D_9D9D_4888_A683_6B2477CEEC38 */
ufm::util
Definition
Iterable.h:28
ufm::lang::Interface
類別共用基礎介面
Definition
Interface.h:152
ufm::util::Container
[Interface] 集合容器介面 此介面定義了集合容器的基本操作。集合容器用於存儲一組元素, 提供了對這些元素的訪問和操作方法。
Definition
Container.h:36
ufm::util::Map::Entry
Map的條目介面,代表一個鍵值對
Definition
Map.h:58
ufm::util::Map::Entry::setValue
virtual V * setValue(V *value) override
設置條目的值
ufm::util::Map::Entry::remove
virtual void remove(void) override
從Map中移除該MapEntry
ufm::util::Map::Entry::getValue
virtual V * getValue(void) override
獲取條目的值
ufm::util::Map::Entry::getKey
virtual int getKey(void) override
獲取條目的鍵
ufm::util::Map
Map模板類別
Definition
Map.h:48
ufm::util::Map::replace
virtual V * replace(ufm::lang::Interface &key, V *value) override
替換指定鍵的值
ufm::util::Map::containsValue
virtual bool containsValue(V *value) const override
檢查map是否包含指定的值
ufm::util::Map::get
virtual V * get(ufm::lang::Interface &key) const override
獲取指定鍵對應的值
ufm::util::Map::remove
virtual V * remove(ufm::lang::Interface &key) override
從map中移除指定鍵的映射
ufm::util::Map::put
virtual V * put(ufm::lang::Interface &key, V *value) override
將指定的值與指定的鍵相關聯
ufm::util::Map::containsKey
virtual bool containsKey(ufm::lang::Interface &key) const override
檢查map是否包含指定的鍵
src
mframe
src
ufm
util
Map.h
產生者:
1.11.0