mFrame
載入中...
搜尋中...
無符合項目
ufm::lang::HashGenerator 類別 參考文件final

雜湊產生器類別,提供雜湊值生成的多種方法 更多...

#include <HashGenerator.h>

類別ufm::lang::HashGenerator的繼承圖:
ufm::lang::NonInstantiable ufm::lang::Object ufm::lang::Interface

靜態公開方法(Static Public Methods)

static int getHashcode (const void *src, int len)
 計算資料區塊的雜湊值
 
static int getHashcode (const char *src)
 計算 C 字串的雜湊值
 
static int getHashcodeUpperCast (const char *src)
 計算 C 字串的雜湊值 (全部字符轉為大寫後計算)
 
static int getHashcodeLowerCast (const char *src)
 計算 C 字串的雜湊值 (全部字符轉為小寫後計算)
 

額外的繼承成員

- 公開方法(Public Methods) 繼承自 ufm::lang::Object
void * operator new (size_t n)
 使用運算子 new 分配記憶體
 
void * operator new (size_t n, void *p)
 在指定記憶體上調用運算子 new
 
virtual ufm::lang::ObjectgetObject (void) override
 取得對應的 Object 物件
 
void delay (int milliseconds) const
 延遲指定的毫秒數進行執行緒等待
 
bool equals (Object *object) const
 判斷與另一物件是否為相同參照(指標型態比較)
 
bool equals (Object &object) const
 判斷與另一物件是否為相同參照(參照型態比較)
 
void wait (void) const
 使當前線程等待直到被通知
 
bool wait (int timeout) const
 等待通知或超時
 
bool yield (void) const
 讓執行緒讓渡控制權給同優先權的下一個執行緒
 
int lock (void) const
 核心鎖定,鎖定期間禁止線程切換
 
int unlock (void) const
 核心解鎖
 
ufm::sys::ThreadcurrentThread (void) const
 取得當前執行緒指標
 
virtual int hashcode (void) const
 返回對象的哈希碼值。支持這種方法是為了散列表,如HashMap提供的那樣。
 
- 公開方法(Public Methods) 繼承自 ufm::lang::Interface
virtual ~Interface (void)=default
 虛擬析構函式
 
- 保護方法(Protected Methods) 繼承自 ufm::lang::NonInstantiable
 NonInstantiable (void)=delete
 禁止實例化 NonInstantiable 類別
 
 NonInstantiable (const NonInstantiable &)=delete
 禁止複製建構函式
 
virtual ~NonInstantiable (void) override=default
 Destroy the Non Instantiable object.
 
NonInstantiableoperator= (const NonInstantiable &)=delete
 
NonInstantiableoperator= (NonInstantiable &&)=delete
 

詳細描述

雜湊產生器類別,提供雜湊值生成的多種方法

函式成員說明文件

◆ getHashcode() [1/2]

static int ufm::lang::HashGenerator::getHashcode ( const char * src)
static

計算 C 字串的雜湊值

對以 '\0' 結束的字串執行雜湊計算。

參數
src字串來源 (null 結尾)
傳回值
int 計算後的雜湊值

◆ getHashcode() [2/2]

static int ufm::lang::HashGenerator::getHashcode ( const void * src,
int len )
static

計算資料區塊的雜湊值

使用基礎演算法計算指定記憶體區塊的雜湊值。

參數
src資料來源指標
len資料長度 (以位元組為單位)
傳回值
int 計算後的雜湊值

◆ getHashcodeLowerCast()

static int ufm::lang::HashGenerator::getHashcodeLowerCast ( const char * src)
static

計算 C 字串的雜湊值 (全部字符轉為小寫後計算)

將字串中所有英文字母轉為小寫後,再進行雜湊計算,可忽略大小寫差異。

參數
src字串來源 (null 結尾)
傳回值
int 計算後的雜湊值

◆ getHashcodeUpperCast()

static int ufm::lang::HashGenerator::getHashcodeUpperCast ( const char * src)
static

計算 C 字串的雜湊值 (全部字符轉為大寫後計算)

將字串中所有英文字母轉為大寫後,再進行雜湊計算,可忽略大小寫差異。

參數
src字串來源 (null 結尾)
傳回值
int 計算後的雜湊值

此類別(class) 文件是由下列檔案中產生: