/jcl/source/common/JclSortedMaps.pas
https://github.com/the-Arioch/jcl · Pascal · 31806 lines · 25993 code · 1791 blank · 4022 comment · 4259 complexity · c01d72d92882d8c6d6cabf3f99cd94f1 MD5 · raw file
Large files are truncated click here to view the full file
- {**************************************************************************************************}
- { WARNING: JEDI preprocessor generated unit. Do not edit. }
- {**************************************************************************************************}
- {**************************************************************************************************}
- { }
- { Project JEDI Code Library (JCL) }
- { }
- { The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); }
- { you may not use this file except in compliance with the License. You may obtain a copy of the }
- { License at http://www.mozilla.org/MPL/ }
- { }
- { Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF }
- { ANY KIND, either express or implied. See the License for the specific language governing rights }
- { and limitations under the License. }
- { }
- { The Original Code is JclSortedMaps.pas. }
- { }
- { The Initial Developer of the Original Code is Florent Ouchet. Portions created by }
- { Florent Ouchet are Copyright (C) Florent Ouchet <outchy att users dott sourceforge dott net }
- { All rights reserved. }
- { }
- { Contributors: }
- { }
- {**************************************************************************************************}
- { }
- { The Delphi Container Library }
- { }
- {**************************************************************************************************}
- { }
- { Last modified: $Date:: $ }
- { Revision: $Rev:: $ }
- { Author: $Author:: $ }
- { }
- {**************************************************************************************************}
- unit JclSortedMaps;
- interface
- {$I jcl.inc}
- uses
- {$IFDEF UNITVERSIONING}
- JclUnitVersioning,
- {$ENDIF UNITVERSIONING}
- {$IFDEF HAS_UNITSCOPE}
- System.Classes,
- {$ELSE ~HAS_UNITSCOPE}
- Classes,
- {$ENDIF ~HAS_UNITSCOPE}
- JclAlgorithms,
- JclBase, JclSynch,
- JclAbstractContainers, JclContainerIntf, JclArrayLists, JclArraySets;
- type
- TJclIntfIntfSortedMapEntry = record
- Key: IInterface;
- Value: IInterface;
- end;
- TJclIntfIntfSortedMapEntryArray = array of TJclIntfIntfSortedMapEntry;
- TJclIntfIntfSortedMap = class(TJclIntfAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclIntfContainer,
- IJclIntfIntfMap, IJclIntfIntfSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: IInterface): IInterface;
- function FreeValue(var Value: IInterface): IInterface;
- function KeysCompare(const A, B: IInterface): Integer;
- function ValuesCompare(const A, B: IInterface): Integer;
- private
- FEntries: TJclIntfIntfSortedMapEntryArray;
- function BinarySearch(const Key: IInterface): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclIntfIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclIntfIntfSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclIntfIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclIntfIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclIntfIntfMap }
- procedure Clear;
- function ContainsKey(const Key: IInterface): Boolean;
- function ContainsValue(const Value: IInterface): Boolean;
- function Extract(const Key: IInterface): IInterface;
- function GetValue(const Key: IInterface): IInterface;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: IInterface): IInterface;
- function KeySet: IJclIntfSet;
- function MapEquals(const AMap: IJclIntfIntfMap): Boolean;
- procedure PutAll(const AMap: IJclIntfIntfMap);
- procedure PutValue(const Key: IInterface; const Value: IInterface);
- function Remove(const Key: IInterface): IInterface;
- function Size: Integer;
- function Values: IJclIntfCollection;
- { IJclIntfIntfSortedMap }
- function FirstKey: IInterface;
- function HeadMap(const ToKey: IInterface): IJclIntfIntfSortedMap;
- function LastKey: IInterface;
- function SubMap(const FromKey, ToKey: IInterface): IJclIntfIntfSortedMap;
- function TailMap(const FromKey: IInterface): IJclIntfIntfSortedMap;
- end;
- TJclAnsiStrIntfSortedMapEntry = record
- Key: AnsiString;
- Value: IInterface;
- end;
- TJclAnsiStrIntfSortedMapEntryArray = array of TJclAnsiStrIntfSortedMapEntry;
- TJclAnsiStrIntfSortedMap = class(TJclAnsiStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclAnsiStrContainer, IJclIntfContainer,
- IJclAnsiStrIntfMap, IJclAnsiStrIntfSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: AnsiString): AnsiString;
- function FreeValue(var Value: IInterface): IInterface;
- function KeysCompare(const A, B: AnsiString): Integer;
- function ValuesCompare(const A, B: IInterface): Integer;
- private
- FEntries: TJclAnsiStrIntfSortedMapEntryArray;
- function BinarySearch(const Key: AnsiString): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclAnsiStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclAnsiStrIntfSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclAnsiStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclAnsiStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclAnsiStrIntfMap }
- procedure Clear;
- function ContainsKey(const Key: AnsiString): Boolean;
- function ContainsValue(const Value: IInterface): Boolean;
- function Extract(const Key: AnsiString): IInterface;
- function GetValue(const Key: AnsiString): IInterface;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: IInterface): AnsiString;
- function KeySet: IJclAnsiStrSet;
- function MapEquals(const AMap: IJclAnsiStrIntfMap): Boolean;
- procedure PutAll(const AMap: IJclAnsiStrIntfMap);
- procedure PutValue(const Key: AnsiString; const Value: IInterface);
- function Remove(const Key: AnsiString): IInterface;
- function Size: Integer;
- function Values: IJclIntfCollection;
- { IJclAnsiStrIntfSortedMap }
- function FirstKey: AnsiString;
- function HeadMap(const ToKey: AnsiString): IJclAnsiStrIntfSortedMap;
- function LastKey: AnsiString;
- function SubMap(const FromKey, ToKey: AnsiString): IJclAnsiStrIntfSortedMap;
- function TailMap(const FromKey: AnsiString): IJclAnsiStrIntfSortedMap;
- end;
- TJclIntfAnsiStrSortedMapEntry = record
- Key: IInterface;
- Value: AnsiString;
- end;
- TJclIntfAnsiStrSortedMapEntryArray = array of TJclIntfAnsiStrSortedMapEntry;
- TJclIntfAnsiStrSortedMap = class(TJclAnsiStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclIntfContainer, IJclAnsiStrContainer,
- IJclIntfAnsiStrMap, IJclIntfAnsiStrSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: IInterface): IInterface;
- function FreeValue(var Value: AnsiString): AnsiString;
- function KeysCompare(const A, B: IInterface): Integer;
- function ValuesCompare(const A, B: AnsiString): Integer;
- private
- FEntries: TJclIntfAnsiStrSortedMapEntryArray;
- function BinarySearch(const Key: IInterface): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclIntfAnsiStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclIntfAnsiStrSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclIntfAnsiStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclIntfAnsiStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclIntfAnsiStrMap }
- procedure Clear;
- function ContainsKey(const Key: IInterface): Boolean;
- function ContainsValue(const Value: AnsiString): Boolean;
- function Extract(const Key: IInterface): AnsiString;
- function GetValue(const Key: IInterface): AnsiString;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: AnsiString): IInterface;
- function KeySet: IJclIntfSet;
- function MapEquals(const AMap: IJclIntfAnsiStrMap): Boolean;
- procedure PutAll(const AMap: IJclIntfAnsiStrMap);
- procedure PutValue(const Key: IInterface; const Value: AnsiString);
- function Remove(const Key: IInterface): AnsiString;
- function Size: Integer;
- function Values: IJclAnsiStrCollection;
- { IJclIntfAnsiStrSortedMap }
- function FirstKey: IInterface;
- function HeadMap(const ToKey: IInterface): IJclIntfAnsiStrSortedMap;
- function LastKey: IInterface;
- function SubMap(const FromKey, ToKey: IInterface): IJclIntfAnsiStrSortedMap;
- function TailMap(const FromKey: IInterface): IJclIntfAnsiStrSortedMap;
- end;
- TJclAnsiStrAnsiStrSortedMapEntry = record
- Key: AnsiString;
- Value: AnsiString;
- end;
- TJclAnsiStrAnsiStrSortedMapEntryArray = array of TJclAnsiStrAnsiStrSortedMapEntry;
- TJclAnsiStrAnsiStrSortedMap = class(TJclAnsiStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclAnsiStrContainer,
- IJclAnsiStrAnsiStrMap, IJclAnsiStrAnsiStrSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: AnsiString): AnsiString;
- function FreeValue(var Value: AnsiString): AnsiString;
- function KeysCompare(const A, B: AnsiString): Integer;
- function ValuesCompare(const A, B: AnsiString): Integer;
- private
- FEntries: TJclAnsiStrAnsiStrSortedMapEntryArray;
- function BinarySearch(const Key: AnsiString): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclAnsiStrAnsiStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclAnsiStrAnsiStrSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclAnsiStrAnsiStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclAnsiStrAnsiStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclAnsiStrAnsiStrMap }
- procedure Clear;
- function ContainsKey(const Key: AnsiString): Boolean;
- function ContainsValue(const Value: AnsiString): Boolean;
- function Extract(const Key: AnsiString): AnsiString;
- function GetValue(const Key: AnsiString): AnsiString;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: AnsiString): AnsiString;
- function KeySet: IJclAnsiStrSet;
- function MapEquals(const AMap: IJclAnsiStrAnsiStrMap): Boolean;
- procedure PutAll(const AMap: IJclAnsiStrAnsiStrMap);
- procedure PutValue(const Key: AnsiString; const Value: AnsiString);
- function Remove(const Key: AnsiString): AnsiString;
- function Size: Integer;
- function Values: IJclAnsiStrCollection;
- { IJclAnsiStrAnsiStrSortedMap }
- function FirstKey: AnsiString;
- function HeadMap(const ToKey: AnsiString): IJclAnsiStrAnsiStrSortedMap;
- function LastKey: AnsiString;
- function SubMap(const FromKey, ToKey: AnsiString): IJclAnsiStrAnsiStrSortedMap;
- function TailMap(const FromKey: AnsiString): IJclAnsiStrAnsiStrSortedMap;
- end;
- TJclWideStrIntfSortedMapEntry = record
- Key: WideString;
- Value: IInterface;
- end;
- TJclWideStrIntfSortedMapEntryArray = array of TJclWideStrIntfSortedMapEntry;
- TJclWideStrIntfSortedMap = class(TJclWideStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclWideStrContainer, IJclIntfContainer,
- IJclWideStrIntfMap, IJclWideStrIntfSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: WideString): WideString;
- function FreeValue(var Value: IInterface): IInterface;
- function KeysCompare(const A, B: WideString): Integer;
- function ValuesCompare(const A, B: IInterface): Integer;
- private
- FEntries: TJclWideStrIntfSortedMapEntryArray;
- function BinarySearch(const Key: WideString): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclWideStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclWideStrIntfSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclWideStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclWideStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclWideStrIntfMap }
- procedure Clear;
- function ContainsKey(const Key: WideString): Boolean;
- function ContainsValue(const Value: IInterface): Boolean;
- function Extract(const Key: WideString): IInterface;
- function GetValue(const Key: WideString): IInterface;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: IInterface): WideString;
- function KeySet: IJclWideStrSet;
- function MapEquals(const AMap: IJclWideStrIntfMap): Boolean;
- procedure PutAll(const AMap: IJclWideStrIntfMap);
- procedure PutValue(const Key: WideString; const Value: IInterface);
- function Remove(const Key: WideString): IInterface;
- function Size: Integer;
- function Values: IJclIntfCollection;
- { IJclWideStrIntfSortedMap }
- function FirstKey: WideString;
- function HeadMap(const ToKey: WideString): IJclWideStrIntfSortedMap;
- function LastKey: WideString;
- function SubMap(const FromKey, ToKey: WideString): IJclWideStrIntfSortedMap;
- function TailMap(const FromKey: WideString): IJclWideStrIntfSortedMap;
- end;
- TJclIntfWideStrSortedMapEntry = record
- Key: IInterface;
- Value: WideString;
- end;
- TJclIntfWideStrSortedMapEntryArray = array of TJclIntfWideStrSortedMapEntry;
- TJclIntfWideStrSortedMap = class(TJclWideStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclIntfContainer, IJclWideStrContainer,
- IJclIntfWideStrMap, IJclIntfWideStrSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: IInterface): IInterface;
- function FreeValue(var Value: WideString): WideString;
- function KeysCompare(const A, B: IInterface): Integer;
- function ValuesCompare(const A, B: WideString): Integer;
- private
- FEntries: TJclIntfWideStrSortedMapEntryArray;
- function BinarySearch(const Key: IInterface): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclIntfWideStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclIntfWideStrSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclIntfWideStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclIntfWideStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclIntfWideStrMap }
- procedure Clear;
- function ContainsKey(const Key: IInterface): Boolean;
- function ContainsValue(const Value: WideString): Boolean;
- function Extract(const Key: IInterface): WideString;
- function GetValue(const Key: IInterface): WideString;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: WideString): IInterface;
- function KeySet: IJclIntfSet;
- function MapEquals(const AMap: IJclIntfWideStrMap): Boolean;
- procedure PutAll(const AMap: IJclIntfWideStrMap);
- procedure PutValue(const Key: IInterface; const Value: WideString);
- function Remove(const Key: IInterface): WideString;
- function Size: Integer;
- function Values: IJclWideStrCollection;
- { IJclIntfWideStrSortedMap }
- function FirstKey: IInterface;
- function HeadMap(const ToKey: IInterface): IJclIntfWideStrSortedMap;
- function LastKey: IInterface;
- function SubMap(const FromKey, ToKey: IInterface): IJclIntfWideStrSortedMap;
- function TailMap(const FromKey: IInterface): IJclIntfWideStrSortedMap;
- end;
- TJclWideStrWideStrSortedMapEntry = record
- Key: WideString;
- Value: WideString;
- end;
- TJclWideStrWideStrSortedMapEntryArray = array of TJclWideStrWideStrSortedMapEntry;
- TJclWideStrWideStrSortedMap = class(TJclWideStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclWideStrContainer,
- IJclWideStrWideStrMap, IJclWideStrWideStrSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: WideString): WideString;
- function FreeValue(var Value: WideString): WideString;
- function KeysCompare(const A, B: WideString): Integer;
- function ValuesCompare(const A, B: WideString): Integer;
- private
- FEntries: TJclWideStrWideStrSortedMapEntryArray;
- function BinarySearch(const Key: WideString): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclWideStrWideStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclWideStrWideStrSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclWideStrWideStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclWideStrWideStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclWideStrWideStrMap }
- procedure Clear;
- function ContainsKey(const Key: WideString): Boolean;
- function ContainsValue(const Value: WideString): Boolean;
- function Extract(const Key: WideString): WideString;
- function GetValue(const Key: WideString): WideString;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: WideString): WideString;
- function KeySet: IJclWideStrSet;
- function MapEquals(const AMap: IJclWideStrWideStrMap): Boolean;
- procedure PutAll(const AMap: IJclWideStrWideStrMap);
- procedure PutValue(const Key: WideString; const Value: WideString);
- function Remove(const Key: WideString): WideString;
- function Size: Integer;
- function Values: IJclWideStrCollection;
- { IJclWideStrWideStrSortedMap }
- function FirstKey: WideString;
- function HeadMap(const ToKey: WideString): IJclWideStrWideStrSortedMap;
- function LastKey: WideString;
- function SubMap(const FromKey, ToKey: WideString): IJclWideStrWideStrSortedMap;
- function TailMap(const FromKey: WideString): IJclWideStrWideStrSortedMap;
- end;
- {$IFDEF SUPPORTS_UNICODE_STRING}
- TJclUnicodeStrIntfSortedMapEntry = record
- Key: UnicodeString;
- Value: IInterface;
- end;
- TJclUnicodeStrIntfSortedMapEntryArray = array of TJclUnicodeStrIntfSortedMapEntry;
- {$ENDIF SUPPORTS_UNICODE_STRING}
- {$IFDEF SUPPORTS_UNICODE_STRING}
- TJclUnicodeStrIntfSortedMap = class(TJclUnicodeStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclUnicodeStrContainer, IJclIntfContainer,
- IJclUnicodeStrIntfMap, IJclUnicodeStrIntfSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: UnicodeString): UnicodeString;
- function FreeValue(var Value: IInterface): IInterface;
- function KeysCompare(const A, B: UnicodeString): Integer;
- function ValuesCompare(const A, B: IInterface): Integer;
- private
- FEntries: TJclUnicodeStrIntfSortedMapEntryArray;
- function BinarySearch(const Key: UnicodeString): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclUnicodeStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclUnicodeStrIntfSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclUnicodeStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclUnicodeStrIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclUnicodeStrIntfMap }
- procedure Clear;
- function ContainsKey(const Key: UnicodeString): Boolean;
- function ContainsValue(const Value: IInterface): Boolean;
- function Extract(const Key: UnicodeString): IInterface;
- function GetValue(const Key: UnicodeString): IInterface;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: IInterface): UnicodeString;
- function KeySet: IJclUnicodeStrSet;
- function MapEquals(const AMap: IJclUnicodeStrIntfMap): Boolean;
- procedure PutAll(const AMap: IJclUnicodeStrIntfMap);
- procedure PutValue(const Key: UnicodeString; const Value: IInterface);
- function Remove(const Key: UnicodeString): IInterface;
- function Size: Integer;
- function Values: IJclIntfCollection;
- { IJclUnicodeStrIntfSortedMap }
- function FirstKey: UnicodeString;
- function HeadMap(const ToKey: UnicodeString): IJclUnicodeStrIntfSortedMap;
- function LastKey: UnicodeString;
- function SubMap(const FromKey, ToKey: UnicodeString): IJclUnicodeStrIntfSortedMap;
- function TailMap(const FromKey: UnicodeString): IJclUnicodeStrIntfSortedMap;
- end;
- {$ENDIF SUPPORTS_UNICODE_STRING}
- {$IFDEF SUPPORTS_UNICODE_STRING}
- TJclIntfUnicodeStrSortedMapEntry = record
- Key: IInterface;
- Value: UnicodeString;
- end;
- TJclIntfUnicodeStrSortedMapEntryArray = array of TJclIntfUnicodeStrSortedMapEntry;
- {$ENDIF SUPPORTS_UNICODE_STRING}
- {$IFDEF SUPPORTS_UNICODE_STRING}
- TJclIntfUnicodeStrSortedMap = class(TJclUnicodeStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclIntfContainer, IJclUnicodeStrContainer,
- IJclIntfUnicodeStrMap, IJclIntfUnicodeStrSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: IInterface): IInterface;
- function FreeValue(var Value: UnicodeString): UnicodeString;
- function KeysCompare(const A, B: IInterface): Integer;
- function ValuesCompare(const A, B: UnicodeString): Integer;
- private
- FEntries: TJclIntfUnicodeStrSortedMapEntryArray;
- function BinarySearch(const Key: IInterface): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclIntfUnicodeStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclIntfUnicodeStrSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclIntfUnicodeStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclIntfUnicodeStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclIntfUnicodeStrMap }
- procedure Clear;
- function ContainsKey(const Key: IInterface): Boolean;
- function ContainsValue(const Value: UnicodeString): Boolean;
- function Extract(const Key: IInterface): UnicodeString;
- function GetValue(const Key: IInterface): UnicodeString;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: UnicodeString): IInterface;
- function KeySet: IJclIntfSet;
- function MapEquals(const AMap: IJclIntfUnicodeStrMap): Boolean;
- procedure PutAll(const AMap: IJclIntfUnicodeStrMap);
- procedure PutValue(const Key: IInterface; const Value: UnicodeString);
- function Remove(const Key: IInterface): UnicodeString;
- function Size: Integer;
- function Values: IJclUnicodeStrCollection;
- { IJclIntfUnicodeStrSortedMap }
- function FirstKey: IInterface;
- function HeadMap(const ToKey: IInterface): IJclIntfUnicodeStrSortedMap;
- function LastKey: IInterface;
- function SubMap(const FromKey, ToKey: IInterface): IJclIntfUnicodeStrSortedMap;
- function TailMap(const FromKey: IInterface): IJclIntfUnicodeStrSortedMap;
- end;
- {$ENDIF SUPPORTS_UNICODE_STRING}
- {$IFDEF SUPPORTS_UNICODE_STRING}
- TJclUnicodeStrUnicodeStrSortedMapEntry = record
- Key: UnicodeString;
- Value: UnicodeString;
- end;
- TJclUnicodeStrUnicodeStrSortedMapEntryArray = array of TJclUnicodeStrUnicodeStrSortedMapEntry;
- {$ENDIF SUPPORTS_UNICODE_STRING}
- {$IFDEF SUPPORTS_UNICODE_STRING}
- TJclUnicodeStrUnicodeStrSortedMap = class(TJclUnicodeStrAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclStrBaseContainer, IJclUnicodeStrContainer,
- IJclUnicodeStrUnicodeStrMap, IJclUnicodeStrUnicodeStrSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: UnicodeString): UnicodeString;
- function FreeValue(var Value: UnicodeString): UnicodeString;
- function KeysCompare(const A, B: UnicodeString): Integer;
- function ValuesCompare(const A, B: UnicodeString): Integer;
- private
- FEntries: TJclUnicodeStrUnicodeStrSortedMapEntryArray;
- function BinarySearch(const Key: UnicodeString): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclUnicodeStrUnicodeStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclUnicodeStrUnicodeStrSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclUnicodeStrUnicodeStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclUnicodeStrUnicodeStrSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclUnicodeStrUnicodeStrMap }
- procedure Clear;
- function ContainsKey(const Key: UnicodeString): Boolean;
- function ContainsValue(const Value: UnicodeString): Boolean;
- function Extract(const Key: UnicodeString): UnicodeString;
- function GetValue(const Key: UnicodeString): UnicodeString;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: UnicodeString): UnicodeString;
- function KeySet: IJclUnicodeStrSet;
- function MapEquals(const AMap: IJclUnicodeStrUnicodeStrMap): Boolean;
- procedure PutAll(const AMap: IJclUnicodeStrUnicodeStrMap);
- procedure PutValue(const Key: UnicodeString; const Value: UnicodeString);
- function Remove(const Key: UnicodeString): UnicodeString;
- function Size: Integer;
- function Values: IJclUnicodeStrCollection;
- { IJclUnicodeStrUnicodeStrSortedMap }
- function FirstKey: UnicodeString;
- function HeadMap(const ToKey: UnicodeString): IJclUnicodeStrUnicodeStrSortedMap;
- function LastKey: UnicodeString;
- function SubMap(const FromKey, ToKey: UnicodeString): IJclUnicodeStrUnicodeStrSortedMap;
- function TailMap(const FromKey: UnicodeString): IJclUnicodeStrUnicodeStrSortedMap;
- end;
- {$ENDIF SUPPORTS_UNICODE_STRING}
- {$IFDEF CONTAINER_ANSISTR}
- TJclStrIntfSortedMapEntry = TJclAnsiStrIntfSortedMapEntry;
- {$ENDIF CONTAINER_ANSISTR}
- {$IFDEF CONTAINER_WIDESTR}
- TJclStrIntfSortedMapEntry = TJclWideStrIntfSortedMapEntry;
- {$ENDIF CONTAINER_WIDESTR}
- {$IFDEF CONTAINER_UNICODESTR}
- TJclStrIntfSortedMapEntry = TJclUnicodeStrIntfSortedMapEntry;
- {$ENDIF CONTAINER_UNICODESTR}
- {$IFDEF CONTAINER_ANSISTR}
- TJclStrIntfSortedMap = TJclAnsiStrIntfSortedMap;
- {$ENDIF CONTAINER_ANSISTR}
- {$IFDEF CONTAINER_WIDESTR}
- TJclStrIntfSortedMap = TJclWideStrIntfSortedMap;
- {$ENDIF CONTAINER_WIDESTR}
- {$IFDEF CONTAINER_UNICODESTR}
- TJclStrIntfSortedMap = TJclUnicodeStrIntfSortedMap;
- {$ENDIF CONTAINER_UNICODESTR}
- {$IFDEF CONTAINER_ANSISTR}
- TJclIntfStrSortedMapEntry = TJclIntfAnsiStrSortedMapEntry;
- {$ENDIF CONTAINER_ANSISTR}
- {$IFDEF CONTAINER_WIDESTR}
- TJclIntfStrSortedMapEntry = TJclIntfWideStrSortedMapEntry;
- {$ENDIF CONTAINER_WIDESTR}
- {$IFDEF CONTAINER_UNICODESTR}
- TJclIntfStrSortedMapEntry = TJclIntfUnicodeStrSortedMapEntry;
- {$ENDIF CONTAINER_UNICODESTR}
- {$IFDEF CONTAINER_ANSISTR}
- TJclIntfStrSortedMap = TJclIntfAnsiStrSortedMap;
- {$ENDIF CONTAINER_ANSISTR}
- {$IFDEF CONTAINER_WIDESTR}
- TJclIntfStrSortedMap = TJclIntfWideStrSortedMap;
- {$ENDIF CONTAINER_WIDESTR}
- {$IFDEF CONTAINER_UNICODESTR}
- TJclIntfStrSortedMap = TJclIntfUnicodeStrSortedMap;
- {$ENDIF CONTAINER_UNICODESTR}
- {$IFDEF CONTAINER_ANSISTR}
- TJclStrStrSortedMapEntry = TJclAnsiStrAnsiStrSortedMapEntry;
- {$ENDIF CONTAINER_ANSISTR}
- {$IFDEF CONTAINER_WIDESTR}
- TJclStrStrSortedMapEntry = TJclWideStrWideStrSortedMapEntry;
- {$ENDIF CONTAINER_WIDESTR}
- {$IFDEF CONTAINER_UNICODESTR}
- TJclStrStrSortedMapEntry = TJclUnicodeStrUnicodeStrSortedMapEntry;
- {$ENDIF CONTAINER_UNICODESTR}
- {$IFDEF CONTAINER_ANSISTR}
- TJclStrStrSortedMap = TJclAnsiStrAnsiStrSortedMap;
- {$ENDIF CONTAINER_ANSISTR}
- {$IFDEF CONTAINER_WIDESTR}
- TJclStrStrSortedMap = TJclWideStrWideStrSortedMap;
- {$ENDIF CONTAINER_WIDESTR}
- {$IFDEF CONTAINER_UNICODESTR}
- TJclStrStrSortedMap = TJclUnicodeStrUnicodeStrSortedMap;
- {$ENDIF CONTAINER_UNICODESTR}
- TJclSingleIntfSortedMapEntry = record
- Key: Single;
- Value: IInterface;
- end;
- TJclSingleIntfSortedMapEntryArray = array of TJclSingleIntfSortedMapEntry;
- TJclSingleIntfSortedMap = class(TJclSingleAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclSingleContainer, IJclIntfContainer,
- IJclSingleIntfMap, IJclSingleIntfSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: Single): Single;
- function FreeValue(var Value: IInterface): IInterface;
- function KeysCompare(const A, B: Single): Integer;
- function ValuesCompare(const A, B: IInterface): Integer;
- private
- FEntries: TJclSingleIntfSortedMapEntryArray;
- function BinarySearch(const Key: Single): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclSingleIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclSingleIntfSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclSingleIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclSingleIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclSingleIntfMap }
- procedure Clear;
- function ContainsKey(const Key: Single): Boolean;
- function ContainsValue(const Value: IInterface): Boolean;
- function Extract(const Key: Single): IInterface;
- function GetValue(const Key: Single): IInterface;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: IInterface): Single;
- function KeySet: IJclSingleSet;
- function MapEquals(const AMap: IJclSingleIntfMap): Boolean;
- procedure PutAll(const AMap: IJclSingleIntfMap);
- procedure PutValue(const Key: Single; const Value: IInterface);
- function Remove(const Key: Single): IInterface;
- function Size: Integer;
- function Values: IJclIntfCollection;
- { IJclSingleIntfSortedMap }
- function FirstKey: Single;
- function HeadMap(const ToKey: Single): IJclSingleIntfSortedMap;
- function LastKey: Single;
- function SubMap(const FromKey, ToKey: Single): IJclSingleIntfSortedMap;
- function TailMap(const FromKey: Single): IJclSingleIntfSortedMap;
- end;
- TJclIntfSingleSortedMapEntry = record
- Key: IInterface;
- Value: Single;
- end;
- TJclIntfSingleSortedMapEntryArray = array of TJclIntfSingleSortedMapEntry;
- TJclIntfSingleSortedMap = class(TJclSingleAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclIntfContainer, IJclSingleContainer,
- IJclIntfSingleMap, IJclIntfSingleSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: IInterface): IInterface;
- function FreeValue(var Value: Single): Single;
- function KeysCompare(const A, B: IInterface): Integer;
- function ValuesCompare(const A, B: Single): Integer;
- private
- FEntries: TJclIntfSingleSortedMapEntryArray;
- function BinarySearch(const Key: IInterface): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclIntfSingleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclIntfSingleSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclIntfSingleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclIntfSingleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclIntfSingleMap }
- procedure Clear;
- function ContainsKey(const Key: IInterface): Boolean;
- function ContainsValue(const Value: Single): Boolean;
- function Extract(const Key: IInterface): Single;
- function GetValue(const Key: IInterface): Single;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: Single): IInterface;
- function KeySet: IJclIntfSet;
- function MapEquals(const AMap: IJclIntfSingleMap): Boolean;
- procedure PutAll(const AMap: IJclIntfSingleMap);
- procedure PutValue(const Key: IInterface; const Value: Single);
- function Remove(const Key: IInterface): Single;
- function Size: Integer;
- function Values: IJclSingleCollection;
- { IJclIntfSingleSortedMap }
- function FirstKey: IInterface;
- function HeadMap(const ToKey: IInterface): IJclIntfSingleSortedMap;
- function LastKey: IInterface;
- function SubMap(const FromKey, ToKey: IInterface): IJclIntfSingleSortedMap;
- function TailMap(const FromKey: IInterface): IJclIntfSingleSortedMap;
- end;
- TJclSingleSingleSortedMapEntry = record
- Key: Single;
- Value: Single;
- end;
- TJclSingleSingleSortedMapEntryArray = array of TJclSingleSingleSortedMapEntry;
- TJclSingleSingleSortedMap = class(TJclSingleAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclSingleContainer,
- IJclSingleSingleMap, IJclSingleSingleSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: Single): Single;
- function FreeValue(var Value: Single): Single;
- function KeysCompare(const A, B: Single): Integer;
- function ValuesCompare(const A, B: Single): Integer;
- private
- FEntries: TJclSingleSingleSortedMapEntryArray;
- function BinarySearch(const Key: Single): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure InitializeArrayAfterMove(var List: TJclSingleSingleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclSingleSingleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclSingleSingleMap }
- procedure Clear;
- function ContainsKey(const Key: Single): Boolean;
- function ContainsValue(const Value: Single): Boolean;
- function Extract(const Key: Single): Single;
- function GetValue(const Key: Single): Single;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: Single): Single;
- function KeySet: IJclSingleSet;
- function MapEquals(const AMap: IJclSingleSingleMap): Boolean;
- procedure PutAll(const AMap: IJclSingleSingleMap);
- procedure PutValue(const Key: Single; const Value: Single);
- function Remove(const Key: Single): Single;
- function Size: Integer;
- function Values: IJclSingleCollection;
- { IJclSingleSingleSortedMap }
- function FirstKey: Single;
- function HeadMap(const ToKey: Single): IJclSingleSingleSortedMap;
- function LastKey: Single;
- function SubMap(const FromKey, ToKey: Single): IJclSingleSingleSortedMap;
- function TailMap(const FromKey: Single): IJclSingleSingleSortedMap;
- end;
- TJclDoubleIntfSortedMapEntry = record
- Key: Double;
- Value: IInterface;
- end;
- TJclDoubleIntfSortedMapEntryArray = array of TJclDoubleIntfSortedMapEntry;
- TJclDoubleIntfSortedMap = class(TJclDoubleAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclDoubleContainer, IJclIntfContainer,
- IJclDoubleIntfMap, IJclDoubleIntfSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: Double): Double;
- function FreeValue(var Value: IInterface): IInterface;
- function KeysCompare(const A, B: Double): Integer;
- function ValuesCompare(const A, B: IInterface): Integer;
- private
- FEntries: TJclDoubleIntfSortedMapEntryArray;
- function BinarySearch(const Key: Double): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclDoubleIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclDoubleIntfSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclDoubleIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclDoubleIntfSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclDoubleIntfMap }
- procedure Clear;
- function ContainsKey(const Key: Double): Boolean;
- function ContainsValue(const Value: IInterface): Boolean;
- function Extract(const Key: Double): IInterface;
- function GetValue(const Key: Double): IInterface;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: IInterface): Double;
- function KeySet: IJclDoubleSet;
- function MapEquals(const AMap: IJclDoubleIntfMap): Boolean;
- procedure PutAll(const AMap: IJclDoubleIntfMap);
- procedure PutValue(const Key: Double; const Value: IInterface);
- function Remove(const Key: Double): IInterface;
- function Size: Integer;
- function Values: IJclIntfCollection;
- { IJclDoubleIntfSortedMap }
- function FirstKey: Double;
- function HeadMap(const ToKey: Double): IJclDoubleIntfSortedMap;
- function LastKey: Double;
- function SubMap(const FromKey, ToKey: Double): IJclDoubleIntfSortedMap;
- function TailMap(const FromKey: Double): IJclDoubleIntfSortedMap;
- end;
- TJclIntfDoubleSortedMapEntry = record
- Key: IInterface;
- Value: Double;
- end;
- TJclIntfDoubleSortedMapEntryArray = array of TJclIntfDoubleSortedMapEntry;
- TJclIntfDoubleSortedMap = class(TJclDoubleAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclIntfContainer, IJclDoubleContainer,
- IJclIntfDoubleMap, IJclIntfDoubleSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: IInterface): IInterface;
- function FreeValue(var Value: Double): Double;
- function KeysCompare(const A, B: IInterface): Integer;
- function ValuesCompare(const A, B: Double): Integer;
- private
- FEntries: TJclIntfDoubleSortedMapEntryArray;
- function BinarySearch(const Key: IInterface): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure FinalizeArrayBeforeMove(var List: TJclIntfDoubleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArray(var List: TJclIntfDoubleSortedMapEntryArray; FromIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure InitializeArrayAfterMove(var List: TJclIntfDoubleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclIntfDoubleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclIntfDoubleMap }
- procedure Clear;
- function ContainsKey(const Key: IInterface): Boolean;
- function ContainsValue(const Value: Double): Boolean;
- function Extract(const Key: IInterface): Double;
- function GetValue(const Key: IInterface): Double;
- function IsEmpty: Boolean;
- function KeyOfValue(const Value: Double): IInterface;
- function KeySet: IJclIntfSet;
- function MapEquals(const AMap: IJclIntfDoubleMap): Boolean;
- procedure PutAll(const AMap: IJclIntfDoubleMap);
- procedure PutValue(const Key: IInterface; const Value: Double);
- function Remove(const Key: IInterface): Double;
- function Size: Integer;
- function Values: IJclDoubleCollection;
- { IJclIntfDoubleSortedMap }
- function FirstKey: IInterface;
- function HeadMap(const ToKey: IInterface): IJclIntfDoubleSortedMap;
- function LastKey: IInterface;
- function SubMap(const FromKey, ToKey: IInterface): IJclIntfDoubleSortedMap;
- function TailMap(const FromKey: IInterface): IJclIntfDoubleSortedMap;
- end;
- TJclDoubleDoubleSortedMapEntry = record
- Key: Double;
- Value: Double;
- end;
- TJclDoubleDoubleSortedMapEntryArray = array of TJclDoubleDoubleSortedMapEntry;
- TJclDoubleDoubleSortedMap = class(TJclDoubleAbstractContainer, {$IFDEF THREADSAFE} IJclLockable, {$ENDIF THREADSAFE}
- IJclIntfCloneable, IJclCloneable, IJclGrowable, IJclPackable, IJclBaseContainer, IJclDoubleContainer,
- IJclDoubleDoubleMap, IJclDoubleDoubleSortedMap)
- protected
- function CreateEmptyContainer: TJclAbstractContainerBase; override;
- function FreeKey(var Key: Double): Double;
- function FreeValue(var Value: Double): Double;
- function KeysCompare(const A, B: Double): Integer;
- function ValuesCompare(const A, B: Double): Integer;
- private
- FEntries: TJclDoubleDoubleSortedMapEntryArray;
- function BinarySearch(const Key: Double): Integer;
- protected
- procedure AssignDataTo(Dest: TJclAbstractContainerBase); override;
- procedure InitializeArrayAfterMove(var List: TJclDoubleDoubleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
- procedure MoveArray(var List: TJclDoubleDoubleSortedMapEntryArray; FromIndex, ToIndex, Count: SizeInt);
- public
- constructor Create(ACapacity: Integer);
- destructor Destroy; override;
- { IJclPackable }
- procedure SetCapacity(Value: Integer); override;
- { IJclDoubleDoubleMap }
- procedure Clear;
- function ContainsKey(const Key: Double): Boolean;
- function ContainsValue(const Value…