Class TCustomAVLTreeMap

Unit

Declaration

type TCustomAVLTreeMap<TKey,TValue,TInfo> = class(TObject)

Description

Hierarchy

  • TObject
  • TCustomAVLTreeMap

Overview

Internal Classes and Records

Public TKeyCollection = class(TTreeEnumerable<TKeyEnumerator,TPKeyEnumerator,TKey,PKey,PNode,TTree>)
Public TKeyEnumerator = class(TAVLTreeEnumerator<TKey,PNode,TTree>)
Public TNodeCollection = class(TTreeEnumerable<TNodeEnumerator,TPNodeEnumerator,PNode,PPNode,PNode,TTree>)
Public TNodeEnumerator = class(TAVLTreeEnumerator<PNode,PNode,TTree>)
Public TPairEnumerator = class(TAVLTreeEnumerator<TTreePair,PNode,TTree>)
Public TPKeyEnumerator = class(TAVLTreeEnumerator<PKey,PNode,TTree>)
Private TPNodeEnumerator = class(TAVLTreeEnumerator<PPNode,PNode,TTree>)
Public TPValueEnumerator = class(TAVLTreeEnumerator<PValue,PNode,TTree>)
Private TTree = class(TCustomAVLTreeMap<TKey,TValue,TInfo>)
Public TValueCollection = class(TTreeEnumerable<TValueEnumerator,TPValueEnumerator,TValue,PValue,PNode,TTree>)
Public TValueEnumerator = class(TAVLTreeEnumerator<TValue,PNode,TTree>)

Internal Types

Public PKey = ˆTKey;
Public PNode = ˆTNode;
Public PPNode = ˆPNode;
Public PValue = ˆTValue;
Public TNode = TAVLTreeNode< TKey, TValue, TInfo, TTree>;
Public TTreePair = TPair<TKey, TValue>;

Fields

Private var FDuplicates: TDuplicates;
Private FComparer: IComparer<TKey>;
Protected FCount: SizeInt;
Protected FRoot: PNode;
Protected FKeys: TEnumerable<TKey>;
Protected FValues: TEnumerable<TValue>;
Protected FOnNodeNotify: TNodeNotifyEvent<PNode>;
Protected FOnKeyNotify: TCollectionNotifyEvent<TKey>;
Protected FOnValueNotify: TCollectionNotifyEvent<TValue>;
Private FNodes: TNodeCollection;

Methods

Protected procedure NodeAdded(ANode: PNode); virtual;
Protected procedure DeletingNode(ANode: PNode; AOrigin: boolean); virtual;
Protected function DoRemove(ANode: PNode; ACollectionNotification: TCollectionNotification; ADispose: boolean): TValue;
Protected procedure DisposeAllNodes(ANode: PNode); overload;
Protected function Compare(constref ALeft, ARight: TKey): Integer; inline;
Protected function FindPredecessor(ANode: PNode): PNode;
Protected function FindInsertNode(ANode: PNode; out AInsertNode: PNode): Integer;
Protected procedure RotateRightRight(ANode: PNode); virtual;
Protected procedure RotateLeftLeft(ANode: PNode); virtual;
Protected procedure RotateRightLeft(ANode: PNode); virtual;
Protected procedure RotateLeftRight(ANode: PNode); virtual;
Protected procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); inline;
Protected procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); inline;
Protected procedure NodeNotify(ANode: PNode; ACollectionNotification: TCollectionNotification; ADispose: boolean); inline;
Protected procedure SetValue(var AValue: TValue; constref ANewValue: TValue);
Protected procedure WriteStr(AStream: TStream; const AText: string);
Private function GetNodeCollection: TNodeCollection;
Private procedure InternalAdd(ANode, AParent: PNode); overload;
Private function InternalAdd(ANode: PNode; ADispisable: boolean): PNode; overload;
Private procedure InternalDelete(ANode: PNode);
Private function GetKeys: TKeyCollection;
Private function GetValues: TValueCollection;
Public constructor Create; virtual; overload;
Public constructor Create(const AComparer: IComparer<TKey>); virtual; overload;
Public function NewNode: PNode;
Public function NewNodeArray(ACount: SizeInt): PNode; overload;
Public procedure NewNodeArray(out AArray: TArray<PNode>; ACount: SizeInt); overload;
Public procedure DisposeNode(ANode: PNode);
Public procedure DisposeNodeArray(ANode: PNode; ACount: SizeInt); overload;
Public procedure DisposeNodeArray(var AArray: TArray<PNode>); overload;
Public destructor Destroy; override;
Public function AddNode(ANode: PNode): boolean; overload; inline;
Public function Add(constref APair: TTreePair): PNode; overload; inline;
Public function Add(constref AKey: TKey; constref AValue: TValue): PNode; overload; inline;
Public function Remove(constref AKey: TKey; ADisposeNode: boolean = true): boolean;
Public function ExtractPair(constref AKey: TKey; ADisposeNode: boolean = true): TTreePair; overload;
Public function ExtractPair(constref ANode: PNode; ADispose: boolean = true): TTreePair; overload;
Public function ExtractNode(constref AKey: TKey; ADisposeNode: boolean): PNode; overload;
Public function ExtractNode(ANode: PNode; ADispose: boolean): PNode; overload;
Public procedure Delete(ANode: PNode; ADispose: boolean = true); inline;
Public function GetEnumerator: TPairEnumerator;
Public procedure Clear(ADisposeNodes: Boolean = true); virtual;
Public function FindLowest: PNode;
Public function FindHighest: PNode;
Public function Find(constref AKey: TKey): PNode;
Public function ContainsKey(constref AKey: TKey; out ANode: PNode): boolean; overload; inline;
Public function ContainsKey(constref AKey: TKey): boolean; overload; inline;
Public procedure ConsistencyCheck; virtual;
Public procedure WriteTreeNode(AStream: TStream; ANode: PNode);
Public procedure WriteReportToStream(AStream: TStream);
Public function NodeToReportStr(ANode: PNode): string; virtual;
Public function ReportAsString: string;

Properties

Public property Nodes: TNodeCollection read GetNodeCollection;
Public property Count: SizeInt read FCount;
Public property Root: PNode read FRoot;
Public property Keys: TKeyCollection read GetKeys;
Public property Values: TValueCollection read GetValues;
Public property Duplicates: TDuplicates read FDuplicates write FDuplicates;
Public property OnNodeNotify: TNodeNotifyEvent<PNode> read FOnNodeNotify write FOnNodeNotify;
Public property OnKeyNotify: TCollectionNotifyEvent<TKey> read FOnKeyNotify write FOnKeyNotify;
Public property OnValueNotify: TCollectionNotifyEvent<TValue> read FOnValueNotify write FOnValueNotify;

Description

Internal Types

Public PKey = ˆTKey;
 
Public PNode = ˆTNode;
 
Public PPNode = ˆPNode;
 
Public PValue = ˆTValue;
 
Public TNode = TAVLTreeNode< TKey, TValue, TInfo, TTree>;
 
Public TTreePair = TPair<TKey, TValue>;
 

Fields

Private var FDuplicates: TDuplicates;
 
Private FComparer: IComparer<TKey>;
 
Protected FCount: SizeInt;
 
Protected FRoot: PNode;
 
Protected FKeys: TEnumerable<TKey>;
 
Protected FValues: TEnumerable<TValue>;
 
Protected FOnNodeNotify: TNodeNotifyEvent<PNode>;
 
Protected FOnKeyNotify: TCollectionNotifyEvent<TKey>;
 
Protected FOnValueNotify: TCollectionNotifyEvent<TValue>;
 
Private FNodes: TNodeCollection;
 

Methods

Protected procedure NodeAdded(ANode: PNode); virtual;
 
Protected procedure DeletingNode(ANode: PNode; AOrigin: boolean); virtual;
 
Protected function DoRemove(ANode: PNode; ACollectionNotification: TCollectionNotification; ADispose: boolean): TValue;
 
Protected procedure DisposeAllNodes(ANode: PNode); overload;
 
Protected function Compare(constref ALeft, ARight: TKey): Integer; inline;
 
Protected function FindPredecessor(ANode: PNode): PNode;
 
Protected function FindInsertNode(ANode: PNode; out AInsertNode: PNode): Integer;
 
Protected procedure RotateRightRight(ANode: PNode); virtual;
 
Protected procedure RotateLeftLeft(ANode: PNode); virtual;
 
Protected procedure RotateRightLeft(ANode: PNode); virtual;
 
Protected procedure RotateLeftRight(ANode: PNode); virtual;
 
Protected procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); inline;
 
Protected procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); inline;
 
Protected procedure NodeNotify(ANode: PNode; ACollectionNotification: TCollectionNotification; ADispose: boolean); inline;
 
Protected procedure SetValue(var AValue: TValue; constref ANewValue: TValue);
 
Protected procedure WriteStr(AStream: TStream; const AText: string);

for reporting

Private function GetNodeCollection: TNodeCollection;
 
Private procedure InternalAdd(ANode, AParent: PNode); overload;
 
Private function InternalAdd(ANode: PNode; ADispisable: boolean): PNode; overload;
 
Private procedure InternalDelete(ANode: PNode);
 
Private function GetKeys: TKeyCollection;
 
Private function GetValues: TValueCollection;
 
Public constructor Create; virtual; overload;
 
Public constructor Create(const AComparer: IComparer<TKey>); virtual; overload;
 
Public function NewNode: PNode;
 
Public function NewNodeArray(ACount: SizeInt): PNode; overload;
 
Public procedure NewNodeArray(out AArray: TArray<PNode>; ACount: SizeInt); overload;
 
Public procedure DisposeNode(ANode: PNode);
 
Public procedure DisposeNodeArray(ANode: PNode; ACount: SizeInt); overload;
 
Public procedure DisposeNodeArray(var AArray: TArray<PNode>); overload;
 
Public destructor Destroy; override;
 
Public function AddNode(ANode: PNode): boolean; overload; inline;
 
Public function Add(constref APair: TTreePair): PNode; overload; inline;
 
Public function Add(constref AKey: TKey; constref AValue: TValue): PNode; overload; inline;
 
Public function Remove(constref AKey: TKey; ADisposeNode: boolean = true): boolean;
 
Public function ExtractPair(constref AKey: TKey; ADisposeNode: boolean = true): TTreePair; overload;
 
Public function ExtractPair(constref ANode: PNode; ADispose: boolean = true): TTreePair; overload;
 
Public function ExtractNode(constref AKey: TKey; ADisposeNode: boolean): PNode; overload;
 
Public function ExtractNode(ANode: PNode; ADispose: boolean): PNode; overload;
 
Public procedure Delete(ANode: PNode; ADispose: boolean = true); inline;
 
Public function GetEnumerator: TPairEnumerator;
 
Public procedure Clear(ADisposeNodes: Boolean = true); virtual;
 
Public function FindLowest: PNode;
 
Public function FindHighest: PNode;
 
Public function Find(constref AKey: TKey): PNode;
 
Public function ContainsKey(constref AKey: TKey; out ANode: PNode): boolean; overload; inline;
 
Public function ContainsKey(constref AKey: TKey): boolean; overload; inline;
 
Public procedure ConsistencyCheck; virtual;
 
Public procedure WriteTreeNode(AStream: TStream; ANode: PNode);
 
Public procedure WriteReportToStream(AStream: TStream);
 
Public function NodeToReportStr(ANode: PNode): string; virtual;
 
Public function ReportAsString: string;
 

Properties

Public property Nodes: TNodeCollection read GetNodeCollection;
 
Public property Count: SizeInt read FCount;
 
Public property Root: PNode read FRoot;
 
Public property Keys: TKeyCollection read GetKeys;
 
Public property Values: TValueCollection read GetValues;
 
Public property Duplicates: TDuplicates read FDuplicates write FDuplicates;
 
Public property OnNodeNotify: TNodeNotifyEvent<PNode> read FOnNodeNotify write FOnNodeNotify;
 
Public property OnKeyNotify: TCollectionNotifyEvent<TKey> read FOnKeyNotify write FOnKeyNotify;
 
Public property OnValueNotify: TCollectionNotifyEvent<TValue> read FOnValueNotify write FOnValueNotify;
 

Generated by PasDoc 0.15.0.