Class TGenHashMap
Unit
GContnrs
Declaration
type generic TGenHashMap<_TKey_,_TItem_> = class(TAbstractHashMap)
Description
no description available, TAbstractHashMap description follows no description available, TContainer description follows Hierarchy
Overview
Internal Types
Methods
Properties
Description
Internal Types
 |
THashKey = function (const Key: _TKey_) : Integer of object; |
|
 |
TItemToString = function (const Item: _TItem_) : String of object; |
|
 |
TKeysEqual = function (const A, B: _TKey_) : Boolean of object; |
|
 |
TKeyToString = function (const Key: _TKey_) : String of object; |
|
Methods
 |
function CursorIsFirst(const Cursor: THashMapCursor): Boolean; override; |
|
 |
function CursorIsLast(const Cursor: THashMapCursor): Boolean; override; |
|
 |
procedure Clear; |
Removes all the items from the container.
|
 |
function Contains(const Key : _TKey_) : Boolean; |
Returns true if the container contains Key.
|
 |
constructor Create(InitialCapacity: Integer = MIN_BUCKET_COUNT); |
Creates an empty hash map and sets his capacity to InitialCapacity.
|
 |
constructor Create(MaxLoadFact: Real); |
Creates an empty hash map and sets his load factor to MaxLoadFact.
|
 |
constructor Create(InitialCapacity: Integer; MaxLoadFact: Real); |
Creates an empty hash map and sets his capacity to InitialCapacity and his load factor to MaxLoadFact.
|
 |
function DefaultHashKey(const Key: _TKey_) : Integer; virtual; |
|
 |
function DefaultItemToString(const Item: _TItem_) : String; virtual; |
|
 |
function DefaultKeysEqual(const A, B: _TKey_) : Boolean; virtual; |
|
 |
function DefaultKeyToString(const Key: _TKey_) : String; virtual; |
|
 |
procedure Delete(const Key: _TKey_); |
Checks if an item with the key Key is present. If a match is found, removes the item from the map. Otherwise raises an exception.
|
 |
procedure DeleteAt(const Position: THashMapCursor); |
Deletes the item designated by Position.
|
 |
destructor Destroy; override; |
Destroys the container.
|
 |
procedure Exclude(const Key : _TKey_); |
Checks if an item with the key Key is present. If a match is found, removes the item from the map.
|
 |
function Find(const Key : _TKey_) : THashMapCursor; |
Checks if an item associated with Key is present. If a match is found, a cursor designating the matching item is returned. Otherwise, NilCursor is returned.
|
 |
function First: THashMapCursor; |
Returns a cursor that designates the first element of the container or NilCursor if the container is empty.
|
 |
function GetItem(const Key: _TKey_): _TItem_; |
|
 |
procedure Include(const Key : _TKey_; const Value: _TItem_); |
Inserts Key and Value into the map. If an entry with the same Key is already in the map, then the old value is replaced.
|
 |
procedure Insert(const Key : _TKey_; const Value: _TItem_); |
Inserts Key and Value into the map. If an entry with the same Key is already in the map, then an exception is raised.
|
 |
procedure Insert(const Key : _TKey_; const Value: _TItem_; out Inserted: Boolean); |
If an entry with the key Key is already in the map, then Inserted is set to false. Otherwise, Insert inserts Key and Value into the map and sets Inserted to true.
|
 |
function IsEmpty: Boolean; inline; |
Returns true if the container is empty.
|
 |
procedure ReadItem(const Key: _TKey_; out Value: _TItem_); |
|
 |
procedure ReadItemAt(const Position: THashMapCursor; out Value: _TItem_); |
|
 |
procedure ReadKeyAt(const Position : THashMapCursor; out Key: _TKey_); |
|
 |
procedure Replace(const Key : _TKey_; const Value: _TItem_); |
Checks if an entry with the key Key is present. If a match is found, assigns Key and Value to the matching entry. Otherwise, an exception is raised.
|
 |
function ToString : String; override; |
Return a string representation for the container.
|
Properties
 |
property BucketCount : Integer read fBucketCount; |
|
 |
property Items[constKey:_TKey_]: _TItem_ read GetItem write Include; |
Provides access to the items in the container.
|
 |
property Keys[constPosition:THashMapCursor]: _TKey_ read GetKeyAt; |
Provides access to the keys in the container.
|
 |
property LoadFactor : Real read GetLoadFactor; |
|
 |
property MaxBucketCount : Integer read fMaxBucketCount; |
|
 |
property MaxLoadFactor : Real read fMaxLoadFactor; |
|
 |
property OnHashKey : THashKey read fOnHashKey write SetOnHashKey; |
|
 |
property OnItemToString : TItemToString read fOnItemToString write SetOnItemToString; |
|
 |
property OnKeysEqual : TKeysEqual read fOnKeysEqual write SetOnKeysEqual; |
|
 |
property OnKeyToString : TKeyToString read fOnKeyToString write SetOnKeyToString; |
|
 |
property Size : Integer read fSize; |
Number of items.
|
Generated by PasDoc 0.13.0 on 2014-07-29 16:12:40
|