Class TGenTreeMap

DescriptionHierarchyInternal TypesFieldsMethodsProperties

Unit

Declaration

type generic TGenTreeMap<_TKey_,_TItem_> = class(TAbstractTreeMap)

Description

no description available, TAbstractTreeMap description follows
no description available, TContainer description follows

Hierarchy

Overview

Internal Types

Public PItem = ˆ_TItem_;
Published TColor = (...);
Published TCompareKeys = function (const A, B: _TKey_) : Integer of object;
Public TEnumerator = specialize TGenEnumerator<_TItem_, TTreeMapCursor>;
Published TItemToString = function (const Item: _TItem_) : String of object;
Published TKeyToString = function (const Key: _TKey_) : String of object;

Methods

Protected function CursorIsFirst(const Cursor: TTreeMapCursor) : Boolean; override;
Protected function CursorIsLast(const Cursor: TTreeMapCursor) : Boolean; override;
Protected procedure CursorMoveNext(const Cursor: TTreeMapCursor); override;
Protected procedure CursorMovePrev(const Cursor: TTreeMapCursor); override;
Public function Ceiling(const Key: _TKey_) : TTreeMapCursor;
Public procedure Clear;
Public function Contains(const Key : _TKey_) : Boolean;
Public constructor Create;
Public function DefaultCompareKeys(const A, B: _TKey_) : Integer; virtual;
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
Public function DefaultKeyToString(const Key: _TKey_) : String; virtual;
Public procedure Delete(const Key: _TKey_);
Public procedure DeleteAt(const Position: TTreeMapCursor);
Public procedure DeleteFirst;
Public procedure DeleteLast;
Public destructor Destroy; override;
Public procedure Exclude(const Key : _TKey_);
Public function Find(const Key : _TKey_) : TTreeMapCursor;
Public function First: TTreeMapCursor;
Public function FirstItem: _TItem_;
Public function FirstKey: _TKey_;
Public function Floor(const Key: _TKey_) : TTreeMapCursor;
Public function GetEnumerator : TEnumerator;
Public function GetItem(const Key: _TKey_): _TItem_;
Public function GetItemAt(const Position: TTreeMapCursor): _TItem_;
Public function GetKeyAt(const Position : TTreeMapCursor) : _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 function Last: TTreeMapCursor;
Public function LastItem: _TItem_;
Public function LastKey: _TKey_;
Public procedure ReadFirstItem(out Value : _TItem_); inline;
Public procedure ReadFirstKey(out Key : _TKey_); inline;
Public procedure ReadItem(const Key: _TKey_; out Value: _TItem_);
Public procedure ReadItemAt(const Position: TTreeMapCursor; out Value: _TItem_);
Public procedure ReadKeyAt(const Position : TTreeMapCursor; out Key: _TKey_);
Public procedure ReadLastItem(out Value : _TItem_); inline;
Public procedure ReadLastKey(out Key : _TKey_); inline;
Public procedure Replace(const Key : _TKey_; const Value: _TItem_);
Public procedure SetItemAt(const Position: TTreeMapCursor; Value: _TItem_);
Public function ToString : String; override;

Properties

Public property ItemAt[constPosition:TTreeMapCursor]: _TItem_ read GetItemAt write SetItemAt;
Public property Items[constKey:_TKey_]: _TItem_ read GetItem write Include;
Public property Keys[constPosition:TTreeMapCursor]: _TKey_ read GetKeyAt;
Public property NilCursor: TTreeMapCursor read fNilCursor;
Public property OnCompareKeys : TCompareKeys read fOnCompareKeys write SetOnCompareKeys;
Public property OnItemToString : TItemToString read fOnItemToString write SetOnItemToString;
Public property OnKeyToString : TKeyToString read fOnKeyToString write SetOnKeyToString;
Public property Size : Integer read fSize;

Description

Internal Types

Public PItem = ˆ_TItem_;
 
Published TColor = (...);
 
Values
  • cBlack:  
  • cRed:  
Published TCompareKeys = function (const A, B: _TKey_) : Integer of object;
 
Public TEnumerator = specialize TGenEnumerator<_TItem_, TTreeMapCursor>;
 
Published TItemToString = function (const Item: _TItem_) : String of object;
 
Published TKeyToString = function (const Key: _TKey_) : String of object;
 

Methods

Protected function CursorIsFirst(const Cursor: TTreeMapCursor) : Boolean; override;
 
Protected function CursorIsLast(const Cursor: TTreeMapCursor) : Boolean; override;
 
Protected procedure CursorMoveNext(const Cursor: TTreeMapCursor); override;
 
Protected procedure CursorMovePrev(const Cursor: TTreeMapCursor); override;
 
Public function Ceiling(const Key: _TKey_) : TTreeMapCursor;

Searches for the first entry whose key is not less than Key. If such an entry is found, a cursor that designates it is returned. Otherwise NilCursor is returned.

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;

Creates an empty tree map.

Public function DefaultCompareKeys(const A, B: _TKey_) : Integer; virtual;
 
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
 
Public function DefaultKeyToString(const Key: _TKey_) : String; virtual;
 
Public procedure Delete(const Key: _TKey_);

Checks if an item with the key to Key is present. If a match is found, removes the item from the map. Otherwise raise an exception.

Public procedure DeleteAt(const Position: TTreeMapCursor);

Deletes the item designated by Position.

Public procedure DeleteFirst;

Deletes the first item.

Public procedure DeleteLast;

Deletes the last item.

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_) : TTreeMapCursor;

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: TTreeMapCursor;

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

Public function FirstItem: _TItem_;

Returns the first Item.

Public function FirstKey: _TKey_;

If the map is empty raises an exception. Otherwise, returns the smallest Key.

Public function Floor(const Key: _TKey_) : TTreeMapCursor;

Searches for the last entry whose key is not greater than Key. If such an entry is found, a cursor that designates it is returned. Otherwise NilCursor is returned.

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

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

Public function LastItem: _TItem_;

Returns the last Item.

Public function LastKey: _TKey_;

If the map is empty raises an exception. Otherwise, returns the greatest Key.

Public procedure ReadFirstItem(out Value : _TItem_); inline;
 
Public procedure ReadFirstKey(out Key : _TKey_); inline;
 
Public procedure ReadItem(const Key: _TKey_; out Value: _TItem_);
 
Public procedure ReadItemAt(const Position: TTreeMapCursor; out Value: _TItem_);
 
Public procedure ReadKeyAt(const Position : TTreeMapCursor; out Key: _TKey_);
 
Public procedure ReadLastItem(out Value : _TItem_); inline;
 
Public procedure ReadLastKey(out Key : _TKey_); inline;
 
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: TTreeMapCursor; Value: _TItem_);
 
Public function ToString : String; override;

Return a string representation for the container.

Properties

Public property ItemAt[constPosition:TTreeMapCursor]: _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:TTreeMapCursor]: _TKey_ read GetKeyAt;

Provides access to the keys in the container.

Public property NilCursor: TTreeMapCursor read fNilCursor;

A nil cursor.

Public property OnCompareKeys : TCompareKeys read fOnCompareKeys write SetOnCompareKeys;
 
Public property OnItemToString : TItemToString read fOnItemToString write SetOnItemToString;
 
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