[Overview][Classes][Procedures and functions][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Implements an unsorted StringList with a fast lookup feature.
Source position: lookupstringlist.pas line 38
type TLookupStringList = class(TStringList) |
||
protected |
||
procedure InsertItem(); override; |
|
Adds a new value to the items and the string map with duplicate enforcement. |
public |
||
constructor Create(); |
|
Constructor for the class instance. |
destructor Destroy; override; |
|
Destructor for the class instance. |
procedure Assign(); override; |
|
Implements object persistence in the class. |
procedure Clear; override; |
|
Clears the content stored in the class instance. |
procedure Delete(); override; |
|
Deletes the value at the specified position. |
function Add(); override; |
|
Adds the specified value to the Strings in the list. |
function AddObject(); override; |
|
Adds the specified values to the Strings and Objects in the list. |
function Contains(); |
|
Determines if the specified value already exists in the string map. |
function Find(); override; |
|
Locates the specified value in the Strings property. |
function IndexOf(); override; |
|
Gets the position in Strings where the specified value is stored. |
end; |
|
Implements an unsorted StringList with a fast lookup feature. |
|
| | ||
| | ||
| | ||
| | ||
TLookupStringList is a TStringList descendant that implements an unsorted string list with a fast lookup feature. Internally it uses a map container, TStringMap from unit AvgLvlTree, which is a balanced tree. The strings are stored in 2 places, in the string list itself and in the map container. The map is used in Contains, IndexOf and Find methods. The map container does not reserve too much memory because the strings are reference counted and not copied.
All values for the Duplicates property are fully supported, including dupIgnore and dupError (unlike in unsorted TStringList class).
This class is useful when you must preserve the order in list, but also need to do fast lookups to see if a string exists, or must prevent duplicates.
Authors: Juha Manninen / Antônio Galvão
Version 4.0 | Generated 2025-05-03 | Home |