mFrame
載入中...
搜尋中...
無符合項目
Map.h
1
8
#ifndef MFRAME_EC6FEC6D_9D9D_4888_A683_6B2477CEEC38
9
#define MFRAME_EC6FEC6D_9D9D_4888_A683_6B2477CEEC38
10
11
/* ********************* * ufm::lan * ufm::lang::System::out().println("\n移除操作:");
12
* ufm::lang::Strings* removedValue = stringMap.remove(*keyInterface1);:System::out().println("\n替換操作:");
13
* ufm::lang::Strings newValue("Updated Second");
14
* ufm::lang::Strings* oldValue = stringMap.replace(*keyInterface2, &newValue);***************************************************************
15
* Include
16
*/
17
18
//----------------------------------------------------------------------------------------
19
20
//----------------------------------------------------------------------------------------
21
#include "./../lang/Iterable.h"
22
#include "./../util/Container.h"
23
24
/* ***************************************************************************************
25
* Namespace
26
*/
27
namespace
ufm::util
{
333
template
<
typename
V>
334
struct
Map;
335
}
// namespace ufm::util
336
337
/* ***************************************************************************************
338
* Class/Interface/Struct
339
*/
340
353
template
<
typename
V =
void
>
354
struct
ufm::util::Map
:
public
ufm::util::Container
{
355
/* *************************************************************************************
356
* SubClass Entry
357
*/
358
364
struct
Entry
{
365
/* ***********************************************************************************
366
* Method
367
*/
373
virtual
int
getKey
(
void
) abstract;
374
380
virtual
V*
getValue
(
void
) abstract;
381
388
virtual
V*
setValue
(V* value) abstract;
389
394
virtual
void
remove
(
void
) abstract;
395
};
396
397
/* *************************************************************************************
398
* Method
399
*/
400
408
virtual
bool
containsKey
(
ufm::lang::Interface
& key)
const
abstract;
409
417
virtual
bool
containsValue
(V* value)
const
abstract;
418
425
virtual
V*
get
(
ufm::lang::Interface
& key)
const
abstract;
426
434
virtual
V*
put
(
ufm::lang::Interface
& key, V* value) abstract;
435
442
virtual
V*
remove
(
ufm::lang::Interface
& key) abstract;
443
451
virtual
V*
replace
(
ufm::lang::Interface
& key, V* value) abstract;
452
};
453
454
/* ***************************************************************************************
455
* End of file
456
*/
457
458
#endif
/* MFRAME_EC6FEC6D_9D9D_4888_A683_6B2477CEEC38 */
ufm::util
Definition
Iterable.h:28
ufm::lang::Interface
類別共用基礎介面
Definition
Interface.h:152
ufm::util::Container
容器介面,定義所有集合容器的基本操作。
Definition
Container.h:176
ufm::util::Map::Entry
Map的條目介面,代表一個鍵值對
Definition
Map.h:364
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
映射表介面,定義鍵值對的容器結構。
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