C# 클래스 Majestic12.FastHash

FastHash: class provides fast look ups at the expense of memory (at least 128k per object). Its designed primarily for those hashes where majority of lookups are unsuccessful (ie object is not present) Status of this work is EXPERIMENTAL, do not make any untested assumptions. History: 15/12/06 Added range check in GetXY sometime in 2005: initial imlpementation
상속: IDisposable
파일 보기 프로젝트 열기: arktronic/sevenauth 1 사용 예제들

공개 메소드들

메소드 설명
Add ( string sKey ) : void

Adds key to the fast hash

Add ( string sKey, object iValue ) : void

Adds key and its value to the fast hash

Contains ( string sKey ) : bool

Checks if given key is present in the hash

Dispose ( ) : void
FastHash ( ) : System
GetLikelyPresentValue ( byte iX, byte iY ) : object

Returns value for likely present keys using first chars (byte)

GetLikelyPresentValue ( string sKey ) : object

Returns value of a key that is VERY likely to be present - this avoids doing some checks that are most likely to be pointless thus making overall faster function

GetValue ( string sKey ) : object

Returns value associated with the key or null if key not present

GetXY ( string sKey, int &iX, int &iY ) : void
PossiblyContains ( char cChar1, char cChar2, int iLength ) : bool

Quickly checks if given chars POSSIBLY refer to a stored key.

this ( string sKey ) : object

Access to values via indexer

비공개 메소드들

메소드 설명
Dispose ( bool bDisposing ) : void

메소드 상세

Add() 공개 메소드

Adds key to the fast hash
public Add ( string sKey ) : void
sKey string Key
리턴 void

Add() 공개 메소드

Adds key and its value to the fast hash
public Add ( string sKey, object iValue ) : void
sKey string Key
iValue object Value
리턴 void

Contains() 공개 메소드

Checks if given key is present in the hash
public Contains ( string sKey ) : bool
sKey string Key
리턴 bool

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

FastHash() 공개 메소드

public FastHash ( ) : System
리턴 System

GetLikelyPresentValue() 공개 메소드

Returns value for likely present keys using first chars (byte)
public GetLikelyPresentValue ( byte iX, byte iY ) : object
iX byte Byte 1 denoting char 1
iY byte Byte 2 denoting char 2 (0 if not present)
리턴 object

GetLikelyPresentValue() 공개 메소드

Returns value of a key that is VERY likely to be present - this avoids doing some checks that are most likely to be pointless thus making overall faster function
public GetLikelyPresentValue ( string sKey ) : object
sKey string Key
리턴 object

GetValue() 공개 메소드

Returns value associated with the key or null if key not present
public GetValue ( string sKey ) : object
sKey string Key
리턴 object

GetXY() 공개 정적인 메소드

public static GetXY ( string sKey, int &iX, int &iY ) : void
sKey string
iX int
iY int
리턴 void

PossiblyContains() 공개 메소드

Quickly checks if given chars POSSIBLY refer to a stored key.
public PossiblyContains ( char cChar1, char cChar2, int iLength ) : bool
cChar1 char Char 1
cChar2 char Char 2
iLength int Length of string
리턴 bool

this() 공개 메소드

Access to values via indexer
public this ( string sKey ) : object
sKey string
리턴 object