Class TGenHashMap

DescriptionHierarchyInternal TypesFieldsMethodsProperties

Unit

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

Public TEnumerator = specialize TGenEnumerator<_TItem_, THashMapCursor>;
Published THashKey = function (const Key: _TKey_) : Integer of object;
Published TItemToString = function (const Item: _TItem_) : String of object;
Published TKeysEqual = function (const A, B: _TKey_) : Boolean of object;
Published TKeyToString = function (const Key: _TKey_) : String of object;

Methods

Protected function CursorIsFirst(const Cursor: THashMapCursor): Boolean; override;
Protected function CursorIsLast(const Cursor: THashMapCursor): Boolean; override;
Protected procedure CursorMoveNext(const Cursor: THashMapCursor); override;
Public procedure Clear;
Public function Contains(const Key : _TKey_) : Boolean;
Public constructor Create(InitialCapacity: Integer = MIN_BUCKET_COUNT);
Public constructor Create(MaxLoadFact: Real);
Public constructor Create(InitialCapacity: Integer; MaxLoadFact: Real);
Public function DefaultHashKey(const Key: _TKey_) : Integer; virtual;
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
Public function DefaultKeysEqual(const A, B: _TKey_) : Boolean; virtual;
Public function DefaultKeyToString(const Key: _TKey_) : String; virtual;
Public procedure Delete(const Key: _TKey_);
Public procedure DeleteAt(const Position: THashMapCursor);
Public destructor Destroy; override;
Public procedure Exclude(const Key : _TKey_);
Public function Find(const Key : _TKey_) : THashMapCursor;
Public function First: THashMapCursor;
Public function GetEnumerator : TEnumerator;
Public function GetItem(const Key: _TKey_): _TItem_;
Public function GetItemAt(const Position: THashMapCursor): _TItem_;
Public function GetKeyAt(const Position : THashMapCursor) : _TKey_;
Public procedure Include(const Key : _TKey_; const Value: _TItem_);
Public procedure Insert(const Key : _TKey_; const Value: _TItem_);
Public procedure Insert(const Key : _TKey_; const Value: _TItem_; out Inserted: Boolean);
Public function IsEmpty: Boolean; inline;
Public procedure ReadItem(const Key: _TKey_; out Value: _TItem_);
Public procedure ReadItemAt(const Position: THashMapCursor; out Value: _TItem_);
Public procedure ReadKeyAt(const Position : THashMapCursor; out Key: _TKey_);
Public procedure Replace(const Key : _TKey_; const Value: _TItem_);
Public procedure SetItemAt(const Position: THashMapCursor; AValue: _TItem_);
Public function ToString : String; override;

Properties

Public property BucketCount : Integer read fBucketCount;
Public property ItemAt[constPosition:THashMapCursor]: _TItem_ read GetItemAt write SetItemAt;
Public property Items[constKey:_TKey_]: _TItem_ read GetItem write Include;
Public property Keys[constPosition:THashMapCursor]: _TKey_ read GetKeyAt;
Public property LoadFactor : Real read GetLoadFactor;
Public property MaxBucketCount : Integer read fMaxBucketCount;
Public property MaxLoadFactor : Real read fMaxLoadFactor;
Public property NilCursor: THashMapCursor read fNilCursor;
Public property OnHashKey : THashKey read fOnHashKey write SetOnHashKey;
Public property OnItemToString : TItemToString read fOnItemToString write SetOnItemToString;
Public property OnKeysEqual : TKeysEqual read fOnKeysEqual write SetOnKeysEqual;
Public property OnKeyToString : TKeyToString read fOnKeyToString write SetOnKeyToString;
Public property Size : Integer read fSize;

Description

Internal Types

Public TEnumerator = specialize TGenEnumerator<_TItem_, THashMapCursor>;
 
Published THashKey = function (const Key: _TKey_) : Integer of object;
 
Published TItemToString = function (const Item: _TItem_) : String of object;
 
Published TKeysEqual = function (const A, B: _TKey_) : Boolean of object;
 
Published TKeyToString = function (const Key: _TKey_) : String of object;
 

Methods

Protected function CursorIsFirst(const Cursor: THashMapCursor): Boolean; override;
 
Protected function CursorIsLast(const Cursor: THashMapCursor): Boolean; override;
 
Protected procedure CursorMoveNext(const Cursor: THashMapCursor); override;
 
Public procedure Clear;

Removes all the items from the container.

Public function Contains(const Key : _TKey_) : Boolean;

Returns true if the container contains Key.

Public constructor Create(InitialCapacity: Integer = MIN_BUCKET_COUNT);

Creates an empty hash map and sets his capacity to InitialCapacity.

Public constructor Create(MaxLoadFact: Real);

Creates an empty hash map and sets his load factor to MaxLoadFact.

Public constructor Create(InitialCapacity: Integer; MaxLoadFact: Real);

Creates an empty hash map and sets his capacity to InitialCapacity and his load factor to MaxLoadFact.

Public function DefaultHashKey(const Key: _TKey_) : Integer; virtual;
 
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
 
Public function DefaultKeysEqual(const A, B: _TKey_) : Boolean; virtual;
 
Public function DefaultKeyToString(const Key: _TKey_) : String; virtual;
 
Public 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.

Public procedure DeleteAt(const Position: THashMapCursor);

Deletes the item designated by Position.

Public destructor Destroy; override;

Destroys the container.

Public 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.

Public 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.

Public function First: THashMapCursor;

Returns a cursor that designates the first element of the container or NilCursor if the container is empty.

Public function GetEnumerator : TEnumerator;
 
Public function GetItem(const Key: _TKey_): _TItem_;
 
Public function GetItemAt(const Position: THashMapCursor): _TItem_;
 
Public function GetKeyAt(const Position : THashMapCursor) : _TKey_;
 
Public 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.

Public 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.

Public 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.

Public function IsEmpty: Boolean; inline;

Returns true if the container is empty.

Public procedure ReadItem(const Key: _TKey_; out Value: _TItem_);
 
Public procedure ReadItemAt(const Position: THashMapCursor; out Value: _TItem_);
 
Public procedure ReadKeyAt(const Position : THashMapCursor; out Key: _TKey_);
 
Public 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.

Public procedure SetItemAt(const Position: THashMapCursor; AValue: _TItem_);
 
Public function ToString : String; override;

Return a string representation for the container.

Properties

Public property BucketCount : Integer read fBucketCount;
 
Public property ItemAt[constPosition:THashMapCursor]: _TItem_ read GetItemAt write SetItemAt;

Provides access to the items in the container.

Public property Items[constKey:_TKey_]: _TItem_ read GetItem write Include;

Provides access to the items in the container.

Public property Keys[constPosition:THashMapCursor]: _TKey_ read GetKeyAt;

Provides access to the keys in the container.

Public property LoadFactor : Real read GetLoadFactor;
 
Public property MaxBucketCount : Integer read fMaxBucketCount;
 
Public property MaxLoadFactor : Real read fMaxLoadFactor;
 
Public property NilCursor: THashMapCursor read fNilCursor;

A nil cursor.

Public property OnHashKey : THashKey read fOnHashKey write SetOnHashKey;
 
Public property OnItemToString : TItemToString read fOnItemToString write SetOnItemToString;
 
Public property OnKeysEqual : TKeysEqual read fOnKeysEqual write SetOnKeysEqual;
 
Public property OnKeyToString : TKeyToString read fOnKeyToString write SetOnKeyToString;
 
Public property Size : Integer read fSize;

Number of items.


Generated by PasDoc 0.13.0 on 2014-07-29 16:12:40